Get Variable Value Using Variable Attributes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2022 03:19 AM
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;
I've not seen if anyone else has tried to accomplish this before.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2022 03:45 AM
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.
Please mark this as correct and helpful based on the impact.
Thanks,
Mohit Kaushik
Mohit Kaushik
ServiceNow MVP (2023-2025)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2022 04:00 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2022 04:10 AM
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2022 05:15 AM
Actually, this seems to pull the short_description or description of the Item rather than the information that has been added to the record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2022 05:27 AM
so you want to display variable data in ref_ac_columns?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader