How to access user full names
Asked by Shannon Campbell:

I've created a confiform with many fields, including the ability to enter a user for a record. the user is not neccessarily the person entering the record, and as such is a field type of 'user'.

During entry of these records, I can select valid users and the full user name is displayed - perfect.

However, when I define an export of these records, this user field is storing the username (login user id), not the user full name. How can I export the user full name?

I've tried creating a second field, defined as type 'calculated' with the following expression:

IF(EMPTY("\[entry.employee\]"),"Employee Missing",USER())

However this user macro only returns my full name (ie the person entering the record), not the description of the user the record relates to.

Can anyone provide any insights on how to capture the user's full name?

![Pic1.png](/t5/image/serverpage/image-id/157771iB84662C7A14F2188/image-size/large?v=v2&px=999 "Pic1.png")![Pic2.png](/t5/image/serverpage/image-id/157772i3160CD6F0EBFFCE2/image-size/large?v=v2&px=999 "Pic2.png")![Pic3.png](/t5/image/serverpage/image-id/157773i991E82F0C05407A3/image-size/large?v=v2&px=999 "Pic3.png")


Answers:
author: Alex Medved _ConfiForms_
body: The best option would be to have something like

```
IF(EMPTY("[entry.employee]"),"Employee Missing","[entry.employee.fullName]")
```

<br />

And I suggest to switch from "Calculated" field type to "Formula", as the "Calculated" is only calculated once, on record creation and is never recalculated

To your original issue with exports - you can define what fields you export and how these should be transformed

<https://wiki.vertuna.com/display/CONFIFORMS/Data+Export+tricks+and+hints>

That means you can easily get dates instead of timestamps, user full names and so on, by setting the export fields (with expressions) in your "view" macros

Any property could be accessed and also "transformed" as needed

<https://wiki.vertuna.com/display/CONFIFORMS/Accessing+field+values+and+properties>

<https://wiki.vertuna.com/display/CONFIFORMS/Virtual+functions>

Alex

comments: author: Shannon Campbell
body: Thanks Alex.


author: Midhun Sugathan
body: Hey [@Alex Medved _ConfiForms_](/t5/user/viewprofilepage/user-id/781630) That was a great suggestion! However, I'm facing a minor trouble. When I'm using \[entry.employee.FullName\] in a table with **Formula** as the field definition, I'm getting the value in the table as;  

Expression: \[Midhun Sugathan\] could not be calculated, Unknown operator or function: Sugathan

I'm assuming we need to do something to consider the spaces between names. Can you help?

comments: author: Alex Medved _ConfiForms_
body: Why would you use something like that in a formula? what do you expect ConfiForms to calculate OUT of your name?


author: Midhun Sugathan
body: May be, I'll explain what I was trying to do. I'm trying to create a new column with the user's full name (in plain format) for querying from another form where I have smart dropdown. When I'm trying to query the current table which has only the User type, I'm just getting their staff ID in the dropdown list. So I was thinking if I can auto-populate a new column with their full name, I can query the new column to my smart dropdown where I will be able see the user's name instead of Staff ID.


author: Alex Medved _ConfiForms_
body: Just add a ConfiForms **Field** macro inside your "view" macro (TableView, CardView, etc) and set it field name parameter to

```
employee.fullName
```

You dont need yet another field definition on your form... you can have custom columns in your views... transformed as needed (lots of [virtual functions](https://wiki.vertuna.com/display/CONFIFORMS/Virtual+functions) here to help, as well as [access to rich properties](https://wiki.vertuna.com/display/CONFIFORMS/Accessing+field+values+and+properties) of the objects themselves)

Alex


author: Midhun Sugathan
body: Perfect! That worked.. Thanks a lot :)


Tags: confiforms

confluence-server

server