Get Variable Value Using Variable Attributes

Wasdom_Kung
Tera Guru

Hello,

I am using a reference field that displays multiple columns of information from the sc_requested_item table, namely the RITM, Created and Requested for columns.

I would also like to pull two values: u_employee_forename and u_employee_surname and also display this in the reference field, is this possible?

I've tried the following as an example:

ref_auto_completer=AJAXTableCompleter,ref_ac_display_value=false,ref_ac_columns=opened_at;requested_for; variables.u_employee_forename,ref_ac_columns_search=true; 

find_real_file.png

I've not seen if anyone else has tried to accomplish this before.

 

11 REPLIES 11

Mohit Kaushik
Mega Sage
Mega Sage

Hi Wasdom,

You can only display a single column value in reference field based on the display value true for that column in the reference table.

But if you want to display multiple columns in the list view when you click on the lookup icon then that is possible.

You have to click on the lookup icon and then in the list view you need to click on the hamburger icon(tripple equal) and configure the list layout. From there you can see multiple columns when you clicking the lookup icon.

find_real_file.png

find_real_file.png

find_real_file.png

Please mark this as correct and helpful based on the impact.

 

Thanks,

Mohit Kaushik

Thanks,
Mohit Kaushik
ServiceNow MVP (2023-2025)

Rafal Rataj1
Giga Expert

based on doku

https://docs.servicenow.com/bundle/quebec-platform-administration/page/administer/field-administration/concept/c_AutoCompleteForReferenceFields.html

you have just separate 3 autocompleters 

  • AJAXReferenceCompleter: Displays matching auto-complete choices as a drop-down choice list. The list only displays the reference table's display value column. Reference fields automatically use this class if there is no other auto-completion class specified.

 

  • AJAXTableCompleter: Displays matching auto-complete choices as rows in a table. The table displays the reference table's display value column and any columns listed in the ref_ac_columns attribute.

 

  • AJAXReferenceChoice: Displays matching auto-complete choices as a drop-down choice-list. The list only displays the reference table's display value column. Furthermore, the list only displays up to 25 matching choices. If there are more than 25 auto-complete choices, the reference field instead displays the choices with the AJAXTableCompleter class.

Wasdom_Kung
Tera Guru

Yeah - I didn't think this way would work.

Instead I am going to try to gather the new user information into the RITM description, and then see if I can use the 'description' column to display the information in the reference instead - this should work, hopefully.

 

ref_auto_completer=AJAXTableCompleter,ref_ac_display_value=false,ref_ac_columns=opened_at;requested_for;description,ref_ac_columns_search=true; 

 

 

Actually, this seems to pull the short_description or description of the Item rather than the information that has been added to the record.

@Wasdom Kung 

so you want to display variable data in ref_ac_columns?

Regards
Ankur

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