How to get Email Address of users in reference field

Akshat8
Tera Contributor

Hello All , My requirement is that I have to get Email Address of users in reference field and not name of the user. Any solution for this. Thanks in advance. Screenshot (314).png

 

 

Screenshot (315).png

 

10 REPLIES 10

Hi @Gary Larsen 
You can add javascript: gs.getUser().getEmail(); in the default value section in the variable.

Ravi Chandra_K
Kilo Patron
Kilo Patron

Hello @Akshat8  

please refer the below thread:

https://www.servicenow.com/community/itsm-forum/need-to-display-user-email-id-based-on-user-referenc...

 

for this, you have to change  the Display Value for the table, but it is not recommended as it would change for all the places user table used.

the best solution would be what Michael Jones suggested, but you have to change the variable type to lookup select box. 

 

please hit thumb up below and mark the answer as correct if it helped!! 

Regards,

Ravi Chandra

Hey @Ravi Chandra_K Thanks a lot for your help. I tried but how to remove the default value coming and the portal hangs very much with lookup select box.

Ankur Bawiskar
Tera Patron
Tera Patron

@Akshat8  

while you type you can show email address by adding variable attribute to that reference variable

add this in your variable attribute

ref_auto_completer=AJAXTableCompleter,ref_ac_columns=email,ref_ac_columns_search=true 

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

Hi @Ankur Bawiskar 
I tried this but its not working .