Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

how to populate list collector values based on another list collector values

sk59
Tera Expert

Hi All,

I have two list collector variables(countries,sites) on the catalog form/portal from.

I need to populate related sites based on the countries selection.

I have written onchange client script which is working if I select only one country. If i select multiple countries below is not displaying all the sites of those countries.

 

var collectorName = 'site';
var filterString = 'u_country=' +newValue;

try{
g_form.setValue(collectorName, '');
var myListCollector = g_list.get(collectorName);
myListCollector.reset();
myListCollector.setQuery(filterString);

}

catch(e){
window[collectorName + 'g_filter'].reset();
window[collectorName + 'g_filter'].setQuery(filterString);
window[collectorName + 'acRequest'](null);
}

please suggest

1 ACCEPTED SOLUTION

Dubz
Mega Sage

try changing your filter string to the below

var filterString = 'u_countryIN' +newValue;

View solution in original post

6 REPLIES 6

Ok i would probably still advise following the method described above but it might be worth opening a new thread to see if anyone else has a more effective way of doing it.

Thanks for your inputs. I will open a new thread for this