Domain Display value - Can we display name only without path?

mattcox
Tera Contributor

Hello,

 

I'm working in a domain separated environment on my Helsinki instance and my users are complaining that it's too diffiuclt to determine domain in lists and form views. This is because the views are showing the full path of the domain so:

 

  TOP/Support Division/Customers/Big  Ones/CustomerA

 

When they want to show

   Customer A

 

I've scourered the community and documentation and cannot find out how to just display the short name on the domains.

 

Is it possible to just display the value of the "Name" field from the domain table in lists and the domain picker? Note that "Name" is what's labeled as the display value on the domain table already, but apparently there is some special behind-the-scenes code that is walking the domain tree and displaying the full path in the reference field display value.

1 ACCEPTED SOLUTION

shruti_tyagi
ServiceNow Employee
ServiceNow Employee

Hey Matt,



When you look in configure list or form layout we are Domain is actually sys_domain filed on domain table. If you go to domain table Domain (sys_domain) column and hierarchy. But in your case you want to show the Name of Domain rather than full hierarchy, in that case you can configure your form or list dot walk domain.name and you will see name for



Screen Shot 2018-01-12 at 11.37.23 AM.png



Screen Shot 2018-01-12 at 11.38.27 AM.png



I understand Column Label 'Name' can be little confusing for users. In that case you will need to do same thing you guys are discussing about to create new custom field and copy value of domain.name on that field. Did you tried to put default value in dictionary record something like 'current.domain.name'



Thanks


Shruti


If the reply was informational, please like, mark as helpful or mark as correct!


View solution in original post

13 REPLIES 13

I used a fix script to copy domain.name to domain.u_display_name.



I then further edited one of the domains to set the name by hand.



In both cases I'm still showing the full path in the list display


In the table, sys_domain gets the value from sys_domain_path attribute. So basically Servicenow system uses only domain path internally.


Suppose we have a custom field as "Display domain". In its calculated field we can have the value as sys_domain.name.   You are taking it as a String field or as a reference?


I built domain.u_display_name as a string field, then set Dispaly =   True on this field.



Let's say I have a domain and I setup the following



doman.name = "CUST A"


doman.u_display_name = "CUST A DIsplay"                                           <-- This is the new custom field



When showing this domain on a list view (say cmdb_ci.list), the display value is still TOP/Division/Customer/CUST A Display



So it appears that for the domain table there is some code-branch behind the scenes that does something like this:



1. Go to reference


2. Walk tree up to top, capturing values


3. Build display by using field marked as "Display" for each node in the domain tree


4. Return full path of display names


sys_domain field is system field which references to domain table and i think it's defined in such a way that it displays full path. I think we can create a another custom domain field which can point the same domain table and then display custom name field. And i think in that case we need have some more scripting to populate the domain value in custom domain field.


shruti_tyagi
ServiceNow Employee
ServiceNow Employee

Hey Matt,



When you look in configure list or form layout we are Domain is actually sys_domain filed on domain table. If you go to domain table Domain (sys_domain) column and hierarchy. But in your case you want to show the Name of Domain rather than full hierarchy, in that case you can configure your form or list dot walk domain.name and you will see name for



Screen Shot 2018-01-12 at 11.37.23 AM.png



Screen Shot 2018-01-12 at 11.38.27 AM.png



I understand Column Label 'Name' can be little confusing for users. In that case you will need to do same thing you guys are discussing about to create new custom field and copy value of domain.name on that field. Did you tried to put default value in dictionary record something like 'current.domain.name'



Thanks


Shruti


If the reply was informational, please like, mark as helpful or mark as correct!