Need to see two columns in reference variable and documented attribute is not working

Kirsten2
Tera Contributor

I have a catalog with a drop down for hardware name and I want the cost to appear next to that. My custom table is the reference table and 'cost' is a field for each record. Name is the main display. 

The attributes I added are: re_auto_completer=AJAXTableCompleter;ref_ac_columns=u_cost;ref_ac_columns_search=true

 

When I fill out the catalog item the dropdown still only shows name.

 

Kirsten2_0-1757551865049.pngKirsten2_1-1757551886487.png

 Any help is appreciated.

4 REPLIES 4

Chaitanya ILCR
Kilo Patron

Hi @Kirsten2 , 

you have to use comma (,) instead of semicolon(;) in the variable attributes

try putting this in the variable attributes

ref_auto_completer=AJAXTableCompleter,ref_ac_columns=u_cost,ref_ac_columns_search=true

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

Bhuvan
Kilo Patron

@Kirsten2 

 

There is a typo in the variable attributes, it must be 'ref' and comma instead of semicolon

 

Update the variable, save the record and try again. If it does not work, clear the cache or try from Incognito or InPrivate window of your browser.

 

Below is reference post,

 

https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-get-two-columns-to-display-...

 

If this helped to answer your query, please mark it helpful & accept the solution. 

 

Thanks,

Bhuvan

kaushal_snow
Mega Sage

Hi @Kirsten2 ,

 

Even if you have configured ref_ac_columns, the dropdown will show only the primary Display field as true. Showing multiple fields once selected requires additional workarounds...

 

1. Use a Lookup Select Box instead of a Reference variable. With this, you can set multiple fields in the Lookup label fields, giving you more control over displayed values.

 

or Add a Custom Display Field: Create a new field (e.g. abc_field in your reference table. Populate it with a combination of Name and Cost, for example via business rule or transform logic. Set that field as the Display field so both values appear once selected....

 

If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.

 

Thanks and Regards,
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/

In the same list if you want one side name should come and another column cost then, you need to change your code to :

ref_auto_completer=AJAXTableCompleter,ref_ac_columns=u_cost,ref_ac_columns_search=true

 

I have replaced semi colon with comma..

 

If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.

 

 

Thanks and Regards,
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/