Filter a reference field on catalog item question

Community Alums
Not applicable

I have a catalog item that I need to see if it's possible to filter a location reference field based on another field.
In the image here when someone checks the SOC box I would like to filter out locations that do not have this feature.
Is this possible and if so how can I accomplish this?
find_real_file.png

3 REPLIES 3

Maik Skoddow
Tera Patron
Tera Patron

Shubham3
Kilo Guru

you can write a dynamic Reference Qualifier on the Location Access Column and get Desired Set of data.

alexaria
Tera Contributor

Thanks Maik.

 

this article worked for me:
How to modify Reference Qualifiers with Catalog Client Scripts – ServiceNow – ServiceNow Think (word...

 

 

and this is the onChange client script:

 

var resetFilter = 'active=true^nameISNOTEMPTY^emailISNOTEMPTY^EQ';
var dynamicFilter = g_form.getValue('your other text var holding encoded query').toString().trim();
var gg = g_list.get('your ref var name'); // GlideList2 object
gg.setQuery(newValue == '' ? resetFilter : dynamicFilter);