- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2022 10:17 AM
Hi All,
Can anyone please help us on the below requirement.
We developed one catalog with few variables.
In that one variable callled Company (Select Box type) with drop down options.
ANd another variable called Region (List collector type ---> Refer to Regions table ---> Region field {List field type}).
And now we want to display the Region choices in slush bucket based on the Company variable selection.
Can anyone please help us with sample script.
Note: Gone through few link in community but no luck.
Advance thanks for the support.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2022 07:52 AM
Hiii,
Below script working fine for us.
Many thanks to
Client script:
function onChange(control, oldValue, newValue, isLoading) {
var headers = g_form.getControl('u_region').parentElement.querySelectorAll('.col-xs-4');
var collectorName = 'u_region';
var filterString = '';
if(newValue == 'Australia'){
filterString = 'question.nameSTARTSWITHu_region^textNOT LIKEAustralia';
}
else if(newValue == 'Austria')
{
filterString = 'question.nameSTARTSWITHu_region^textNOT LIKEAustria';
}
setCollectorFilter();
function setCollectorFilter()
{
//If it hasn't rendered yet, wait 100ms and try again.
if(typeof(window[collectorName + 'g_filter']) == 'undefined')
{
setTimeout(setCollectorFilter, 50);
return;
}
//Reset the filter query
window[collectorName + 'g_filter'].reset();
window[collectorName + 'g_filter'].setQuery(filterString);
window[collectorName + 'acRequest'](null);
//Redisplay the list collector variable
//g_form.setDisplay(collectorName,true);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2022 12:28 AM
Hi Ankur,
Many thanks for the response.
We changed our approach and now the list collector option displaying in down order.
But now Based on the select type variable selection need to hide the list collector variable options.
Like above scenario, when we select Australia as a option in first variable, then we need to hide/remove the Australia option from list collector variable.
Advance thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2022 10:38 PM
Hi,
you cannot hide; you can filter the records in slush bucket as it's reference
Please use advanced ref qualifier on list collector and restrict
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
06-26-2022 02:37 AM
Thanks for the response Ankur.
Could you please provide us the sample advanced ref qualifier script to restrict for the above logic.
Advance thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2022 10:39 PM
@ar
Hope you are doing good.
Did my reply answer your question?
If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.
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
06-23-2022 09:22 PM