How can I control list view in reference field?

Paul125
Kilo Guru

Hello, can I add attributes or something else to change list view in reference field? For an instance changing the Name column from first place to different place. Thanks!

1 ACCEPTED SOLUTION

Brent Sutton
Mega Sage

Hi Paul,

Can I check that you are talking about the order that columns are displayed dynamically when you search in the reference field?

If so, you can use "ref_ac_columns" and "ref_ac_display_value" attributes to control the order of columns displayed in the auto complete suggestions.

Right click on field to access context menu >> Configure Dictionary >> Attributes

Set "ref_ac_display_value" to false to hide the displayValue. Then in the "ref_ac_columns" attribute add the name column in the order you want the column shown. Please see example below:

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

The above example would display the user name first and then the name column in the auto complete results:

find_real_file.png

More information can be found in the ServiceNow Docs, under Dictionary Attributes, if you want to dig into it.

Let me know if this helped.

Brent

 

View solution in original post

6 REPLIES 6

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Paul,

 

You can configure the fields in list view via the sys_popup view. Please refer the below documentation for more info.

https://docs.servicenow.com/administer/field_administration/task/t_FieldsDisplayed.html

 

Thanks,

Pradeep Sharma

Brent Sutton
Mega Sage

Hi Paul,

Can I check that you are talking about the order that columns are displayed dynamically when you search in the reference field?

If so, you can use "ref_ac_columns" and "ref_ac_display_value" attributes to control the order of columns displayed in the auto complete suggestions.

Right click on field to access context menu >> Configure Dictionary >> Attributes

Set "ref_ac_display_value" to false to hide the displayValue. Then in the "ref_ac_columns" attribute add the name column in the order you want the column shown. Please see example below:

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

The above example would display the user name first and then the name column in the auto complete results:

find_real_file.png

More information can be found in the ServiceNow Docs, under Dictionary Attributes, if you want to dig into it.

Let me know if this helped.

Brent

 

Thanks for the reply Brent. Is there anyway that I can give user to select other than 'Name' in the field? Thanks again.

Example: I should be able to select User Name in the field instead of name.

Hi Paul,

The only way that I am aware of to change the column displayed in a reference field is to amend the display value column on the table you are referencing. If you do this you will be changing this globally so you have to be sure that this is actually your desired outcome. Additional information about reference field display values can be found here.

Instructions on how to change the table display value can be found at the following link:

Select a field as the table display value

* NOTE: there can only be one display value per table.

Let me know how you get along

Brent

P.S. Please mark as helpful and correct if this answered your question.