How to get Email Address of users in reference field

Shivani_singh
Tera Contributor

Hi @Ankur Bawiskar 
I want to display the email id value of the users instead of the name of the user .
I have created one field as email id which is referencing to sys_user,but when i am selecting the email id its displaying the user name .
As you suggested  to use the variable attributes i used it ,but after that all the value are hidden .
Have attached the screenshot.

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@Shivani_singh 

when you use ref_ac_columns then when the users types it will show email, but once user is selected it will always show name of that user.

Reason: name field on sys_user is display

Why not have another single line text variable to store the email and auto populate that whenever User is selected in reference variable?

You can use auto populate feature available starting from Utah without scripting

Auto-populate a variable based on a reference type variable (Utah) 

OR Another way

1) to use Lookup Select box variable with this config and it will show always Email

AnkurBawiskar_0-1746624015414.png

 

AnkurBawiskar_1-1746624031224.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar 
I tried the way you suggested ,but its not showing all the email which are there in the sys_user table.

@Shivani_singh 

all users in sys_user have email?

use this and it showed me all emails

1) don't give anything in variable attributes

2) don't give anything in Lookup label fields

AnkurBawiskar_0-1746624989819.png

 

Output:

AnkurBawiskar_1-1746625021136.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar 
Yes all the user have email in sys_user table
Have the attached the scrrenshot.