can we show two table fields in one variable?

Hafila Hatta
Tera Guru

hi, i have a custom table whereby theres column:

 

column A: building code

column B: building name

 

in the catalog item, is there anyway i can display both in one variable? tried ref_ac_columns but its not working

4 REPLIES 4

kaushal_snow
Giga Sage

@Hafila Hatta ,

 

can you share what you have used while trying ref_ac_columns ?

 

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 Technical Consultant - ServiceNow Class of Legends 2025

@Hafila Hatta ,

 

ref_auto_completer=AJAXTableCompleter,ref_ac_columns=building_code;building_name,ref_ac_columns_search=true

 

however.......once the user selects the record, only the table single display value is shown in the field........ because snow reference fields can only display one display value after selection .......you cannot have a two field display in that single reference variable by default.......

 

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 Technical Consultant - ServiceNow Class of Legends 2025

Ankur Bawiskar
Tera Patron
Tera Patron

@Hafila Hatta 

if you use reference or list collector you can use ref_ac_columns so that when user types they see both the columns, but after selecting the record they will only see the value of field which is marked as Display=true

Instead if you use Lookup Select Box variable and point to that table you can show both columns

Something like this -> specify the columns in Lookup label fields as comma separated

 

AnkurBawiskar_2-1766372458406.png

 

AnkurBawiskar_3-1766372475241.png

After Selecting the record you will see both the columns

AnkurBawiskar_4-1766372494284.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

Ankur Bawiskar
Tera Patron
Tera Patron

@Hafila Hatta 

if you want to go with reference or list collector variable

you need to give the ref_ac_columns attributes for that and give the additional fields

ref_auto_completer=AJAXTableCompleter,ref_ac_columns=category;serial_number,ref_ac_columns_search=true,ref_ac_order_by=name

Variable attributes sections

AnkurBawiskar_5-1766372545962.png

 

Output: I have added category and serial_number as extra fields to be shown along with name

AnkurBawiskar_6-1766372557386.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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