The CreatorCon Call for Content is officially open! Get started here.

Display value in a reference field

ceraulo
Mega Guru

Hello!

I have a catalog item that has a reference field to a custom table (u_custom). I want to be able to search for the 'number' or 'short description' in this field. When selected, the display should be 'Number - Short description'.

Is this possible?

Please help!

Thank you. 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@ceraulo 

You can add "ref_ac_columns" attribute to the field/variable and it will let search those fields too.

ref_ac_columns=number;short_description;

But once selected it would show the display value on that table and not 2 fields

ref_auto_completer=AJAXTableCompleter,ref_ac_columns=number;short_description;ref_ac_columns_search=true,ref_ac_order_by=name

Regards
Ankur

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

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@ceraulo 

You can add "ref_ac_columns" attribute to the field/variable and it will let search those fields too.

ref_ac_columns=number;short_description;

But once selected it would show the display value on that table and not 2 fields

ref_auto_completer=AJAXTableCompleter,ref_ac_columns=number;short_description;ref_ac_columns_search=true,ref_ac_order_by=name

Regards
Ankur

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

@Ankur Bawiskar 

Ankur, I tried your suggestion. I tried typing the first few letters of the short description and it showed the available values for selection.

But when I input the first letters of the number (ex. CST) nothing is displayed.

Is there something else that I need to update to display the available values when I input "CST"?

Thank you.

I've fixed it. the issue was I used a semi-colon instead of a colon to separate one attribute to another.

Thank you.

@ceraulo 

Glad to help.

Please mark appropriate response as helpful as well

Regards
Ankur

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