- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2024 02:41 PM
I have 2 fields one is Geo (choice) field and another is location(reference) field . In my location field i have over rided the reference qualifier and kept 3 locations India, Philippines, Mexico . Now in geo field i have two options NA and APAC . Now I need a functionality such that if I select NA in the geo field the search box in the location field should have only Mexico as location to select similarly if i select APAC only India and Philippines should be visible to select . How can I achieve this ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2024 04:38 PM - edited ‎09-23-2024 06:59 AM
You should be able to do this all within the reference qualifier like this:
var ret='sys_idIN';if(current.u_geo == 'NA'){ret += 'sys_id of Mexico';}else{ret += 'sys_id of India, sys_id of Philippines';}ret;
Where u_geo is the choice field name, which has the actual value of 'NA',
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2024 07:23 AM
Hi @Brad Bowman I have tried the reference qualifier provided by you
var ret='sys_idIN';if(current.geo == 'NA'){ret += '7f7d7db1db59c450462e771c8c9619d8';}else{ret += '7b7d7db1db59c450462e771c8c9619d3', '87e28ef5db59c450462e771c8c9619ea';}ret;
I even tried removing the var ret in the beginning but no use its showing all the locations
my geo field (GEO/geo)(label/value)
choices
NA/na
APAC/apac
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2024 08:35 AM
Do you have the javascript colon in front of that from my screenshot? It translates incorrectly if typed in this editor is why I left it out of the code box. You should use 'na' since that is the choice value. Have you tested by selecting both choices?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2024 09:26 AM
yeah I have tried selecting both choices even I have kept the value na
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2024 09:34 AM
Thanks @Brad Bowman it was my bad . Now the solution is working fine . Thankyou for your help.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2024 08:35 AM
@kiran kumar m1 Ideally the solution suggested by Brad should work. In case if you are finding it difficult to make the reference qualifier work, I recommend you to create a script include, put your logic inside the script include method and call the script include method inside the reference qualifier.
You can use this thread https://www.servicenow.com/community/developer-forum/how-to-write-advanced-reference-qualifier-scrip... as a reference to know how advanced reference qualifier using script include can be created.
Hope this helps.