How to display only email address

PRAGHATIESH S
Tera Expert

Hi,

I created one catalog item with Email field.

This field reference to the sys_user table, I want to display only email address of the user.

I aware about the display value make it true. But it will be affect globally. So

 

Is it possible to achieve using catalog client script or any other way? Can anyone suggest here.

 

Thank you 

4 REPLIES 4

Rohit  Singh
Mega Sage

Hi @PRAGHATIESH S ,

 

You can create one more variable type-single line text and make it read only. Then you can store the value of email address of the selected user without scripting. This can be workaround.

 

You can refer how to store email id of user selected in sys_user reference 

Auto-Populate Reference data in Service Catalog - ServiceNow Community 

 

If my response helped, please hit the Thumb Icon and accept the solution so that it benefits future readers.

 

Regards,
Rohit

dgarad
Giga Sage

Hi @PRAGHATIESH S 

Refer the below link.

https://www.servicenow.com/community/developer-forum/catalog-client-script-to-get-logged-in-username...

If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.

Thanks
dgarad

Ankur Bawiskar
Tera Patron
Tera Patron

@PRAGHATIESH S 

not possible.

Why not use another single line text variable and auto populate it based on user selected?

you can achieve this without scripting using auto populate feature starting from Utah

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

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

SanjivMeher
Kilo Patron
Kilo Patron

You can use ref_ac_columns=emails in the variable attribute as well.

 

ref_auto_completer=AJAXTableCompleter,ref_ac_columns=name;user_name;email,ref_ac_order_by=name,ref_ac_columns_search=true

 

Another option would be to change it to a lookup select box, where you can specify which field you would like to display in the variable. Ex in the Lookup label fields, use email

SanjivMeher_0-1742450669962.png

 

 


Please mark this response as correct or helpful if it assisted you with your question.