- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2021 03:26 AM
Hi All,
I have a dropdown field for the country in catalog item and I wanted to filter location which is a reference field based on the selected location.
I am trying to write a reference qualifier and but values are still not filtering.
function getLocations(country_var) {
var sys_id_list = [];
var gr1 = new GlideRecord('cmn_location');
gr1.addQuery('state', country_var);
gr1.query();
while (gr1.next()) {
sys_id_list.push(gr1.getValue('name'));
}
return 'sys_idIN' + sys_id_list;
}
On location variable - I have added this qualifier javascript: getLocations(current.variables.country)
Any help would be appreciated
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2021 03:56 AM
Hi,
then you don't need script include for this
Your advanced ref qualifier should be like this since you are querying with the state field
javascript: 'state=' + current.variables.country;
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2021 03:56 AM
Hi,
then you don't need script include for this
Your advanced ref qualifier should be like this since you are querying with the state field
javascript: 'state=' + current.variables.country;
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader