Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

How to get two columns to display in a reference field?

gjz1
Giga Expert

In my company we have departments with multiple divisions in each department.   Many departments have the same division name, for example Administration is a division in all the departments.

I created a new division table with a reference field to Departments (cmn_department) and added the division reference field to the user table (sys_user) and form.   However, I need two columns, division and department in order to differentiate which division to select.   I have added attributes to the Division reference field but I'm still not getting Division and Department as columns, only Division.   What am I missing?

On the User form:

1.   I added Division as a reference field.

2.   I selected Configure Dictionary on the division field.

3.   In Advanced View I added ref_auto_completer=AJAXTableCompleter,ref_ac_columns=u_department,ref_ac_order_by=name to Attributes.

I have tried multiple variations of the attributes, none of it seems to work.

This is in Jakarta.

11 REPLIES 11

andymcdonald
Mega Guru

Hi Greta - do you want fields on your user form as follows?


division.department.<field 1>


division.department.<field 2>


Ankur Bawiskar
Tera Patron

Hi Greta,



Since it is a reference field it will show value of only 1 column which is display=true.


you can have more than 1 columns being shown while user types in something which is what done by ref_ac_columns attribute.



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


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

Hi @Ankur Bawiskar  

I also need the same thing, I am having a  reference type variable in record producer, where in I have used ref_ac_columns_search=true,ref_auto_completer = AJAXTableCompleter,ref_ac_columns= u_manufacturer_other;u_product_name;u_product_version

in the variable attributes

 

So, in the record producer for that variable, all the 4 columns are getting displayed

But , while selecting any value its only showing the display value field. Please help me how to show 2 of the fields when selected (product name and product version along with my original display value.)

Hi,

it would show only 1 field once selected the one which is Display=true

not possible to show 2 fields once selected unless you create custom field; add info from both the fields in that and make that as display=true

Regards
Ankur

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