How can I create a reference field on a table just to display all characters in front of a dash

beycos
Tera Contributor

Hello,

I have a table where the "Display name" is automatically shown as "name - company - environment", and the Display field is set to true. I do not want to change this configuration.

However, I am using this table as a reference field on another table (X), and the reference field also shows "name - company - environment". For this specific reference field, I would like to display only the "name" part (the text before the first dash).

How can I achieve this in ServiceNow?

Is it possible to do this with a client script?

Thank you in advance for any help.

Regards,

Beyza

1 REPLY 1

Ankur Bawiskar
Tera Patron

@beycos 

not possible directly.

But try to use client script and try to use DOM manipulation and see if you can hide the other part.

Note: DOM manipulation is not recommended

💡 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