Taking Cmn_loaction Reference for four fields Country, City, State, Address
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2024 10:31 PM - edited 04-01-2024 10:32 PM
Hi,
I have created four fields for all Country, City, State, Address and Taking Cmn_loaction Reference for all four fields.
When i select country: only country should be displayed.
When i select State: based on the country selected state should be displayed.
When i select City: Based on country and state selected. City should display.
When i select Adress: Based on country and state and city selected. address should display.
But, all are showing only address.
How to acheive this in service now table form. Can someone help me on this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 10:58 PM
But, if i give display value true for one field for all feilds it takes same
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2024 06:37 AM
Hello, @VikramM1
Do you came up with a solution for that
Actually, my proposal suggests that you write to the attributes of the custom fields in the sys_dictionary table. This way, you are setting ref_ac_columns to determine which variables are visible in the reference variable. You are not changing the display value of the cmn_location.
This is what I mean:
But as I mentioned in my previous response, this is what it will look like (displaying the full address name since it is the Display Value in the cmn_location table), which may not be the desired outcome.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2024 10:03 PM
Thanks for your tries and approaches. I will find a different way then.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 07:53 AM
@VikramM1 You need to add following reference qualifier on your fields.
1. Country field:
javascript:'cmn_location_type=country'
2. State
javascript: 'country='+current.variables.country
3. City
javascript: 'country='+current.variables.country+'^state='+current.variables.state
4. Address
javascript: 'country='+current.variables.country+'^state='+current.variables.state+'^city='+current.variables.city
Here is how the reference qualifier should look on address field. Similarly configure for others.
You can read more about reference qualifier here https://docs.servicenow.com/bundle/washingtondc-platform-administration/page/script/server-scripting....
Hope this helps.