How to change search key in Reference/List field on Service Portal?

Junichi Kaneda
Kilo Expert

How to change search key in Reference/List field on Service Portal?

By default, search key is name of user, but I want to search by user id.

find_real_file.png

1 ACCEPTED SOLUTION

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi,

In the reference field attributes, please add the line

ref_auto_completer=AJAXTableCompleter,ref_ac_columns=user_name,ref_ac_columns_search=true,ref_ac_display_value=false

This will allow you to search on user_name.

If I have answered your question, please mark my response as correct and/or helpful.

Thank you very much

Cheers
Alberto

View solution in original post

3 REPLIES 3

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi,

In the reference field attributes, please add the line

ref_auto_completer=AJAXTableCompleter,ref_ac_columns=user_name,ref_ac_columns_search=true,ref_ac_display_value=false

This will allow you to search on user_name.

If I have answered your question, please mark my response as correct and/or helpful.

Thank you very much

Cheers
Alberto

Thank you very much!!!!

I have to learn more about field attributes.

Harsh Vardhan
Giga Patron

if you will set the display true on user_name column it will show but it will impact globally on all the reference field or variable, which has been referred to the sys_user table. 

 

you can show userid as search column use below doc for more details. 

 

ref_auto_completer=AJAXTableCompleter,ref_ac_columns=department,ref_ac_order_by=department


https://docs.servicenow.com/bundle/newyork-platform-administration/page/administer/field-administrat...