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 12:08 AM
Can you please specify what i need to mention in Type and parent [Type] = Address AND [Parent] = javascript:current.getValue('city')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2024 11:40 PM
Hi @VikramM1 ,
you can refer Incident table, category and subcategory as an example.
Subcategory is a dependent field of category.
- Open subcategory of the incident and can see that "use dependent field" is checked and "dependent on field" is "category".
- Now open any choice and you can see the field "dependent value" and we need to provide the value of the category to which this option should display.
Use this as an example and finish your requirement.
Note: Please Mark this Helpful and Accepted Solution. If this Helps you to understand. This will help both the community and me.
Regards,
Deborah Brown
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 07:31 AM
Hello @VikramM1,
Hope you are feeling good.
You can try adding the following advanced reference qualifiers:
State: (current case it is called u_state_country)
javascript: current.u_country ? 'country=' + current.u_country.country : '';
City: (current case it is called u_city)
javascript: current.u_state_country && current.u_country ? 'country=' + current.u_country.country+ '^state=' + current.u_state_country.state : '';
Address: (current case it is called u_address)
javascript: current.u_state_country && current.u_country && current.u_city ? 'country=' + current.u_country.country+ '^state=' + current.u_state_country.state + '^city=' + current.u_city.city: '';
This way it will filter it the way you want it.
If your purpose is to display only the names for each field without additional information (as in the picture), I will work on it and send you the response as soon as I am ready.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 09:29 PM
Hi kkrushkov,
Any update on the this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 10:44 PM - edited 04-02-2024 10:44 PM
Based on my research and efforts, this appears to be the closest way for achieving your intended purpose.
But it will still show it like this:
since this is the display value configured in the dictionary table.
You can check this for reference:
Solved: How to set the Custom list view for reference fiel... - ServiceNow Community