Display name for a reference variable

Khanna Ji
Tera Guru

Hi Team,

I have a requirement where I am showing the full name + user id of a user on a portal with a reference variable on portal. For this I have created a new field called u_user_name_id. On insert/update on user table, I am updating the field value with a contamination of the user full name + id.

Now I had changed display value to true for this field but it is affecting other catalog items where we do not want like this. It had been escalated so I changed the display value back to full name to true.

Now how can I show my newly created field value in the variable without changing the display value property?

1 ACCEPTED SOLUTION

Hi,

in that case then you need to set that field as display=true i.e. asset_tag

now one thing could be possible since that table already contains name field it would by default show during lookup but once you select it would show asset tag or the custom field

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

View solution in original post

13 REPLIES 13

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

that's correct you should have only 1 field as display=true

since you now set display=true for this new field it will affect all places where user is being referenced

what you can do is show this newly created field using ref_ac_columns

ref_ac_columns=u_user_name_id

https://community.servicenow.com/community?id=community_question&sys_id=d5b1db6ddbdcdbc01dcaf3231f96...

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Tried it for asset but it did not work. It is still showing display name of the asset instead of asset tag.

find_real_file.png

-------------------------------------

find_real_file.png

Hi,

by default it would show the field which is display=true on that table even though it is not present in ref_ac_columns

In addition to that you can show additional columns using ref_ac_columns

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

yes, so it should show asset tag also along with display name.

It should be like P1000104 - Apple iMac 27" P1000104

 

Red part is display name and yellow is asset tag. But in the field after selecting a value, it just shows Display name of the asset.