remove option from a list collector on a record producer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-12-2019 11:56 PM
Hi,
I have a requirement on a record producer to remove certain options when another variable choice is selected above. e.g. if subcategory is "lease", then remove option "other" in the list collector.
I have tried a catalog client script but i can't get it to work. This is onChange of the subcategory variable:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if (newValue== 'Lease') {
g_form.removeOption('u_type', 'Other');
}
Can anyone help?
Many thanks
M
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2019 12:25 AM
Hi,
maybe remove Item will help here.
Please have a look at below threads.
https://community.servicenow.com/community?id=community_question&sys_id=75c89545db5b9f400be6a345ca961988
Thanks
Harshad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2019 12:29 AM
HI,
If i understood you properly, then you have to filter list collector depending upon certain variables.
If yes then you need OnChange client script on RP.
See below links for scripts:(If Service Portal then we have to twick the script little bit)
https://www.servicenowguru.com/scripting/client-scripts-scripting/changing-filter-list-collector-variable-client-script/
https://community.servicenow.com/community?id=community_question&sys_id=6d910769db98dbc01dcaf3231f96193f
Thanks,
Ashutosh
ServiceNow MVP 2019
Please Mark Answer as Helpful or Correct Based on it's impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2019 01:33 AM
yes that's right. My coding is not the best; how would i apply this in my setting? It seems to be removing the filter entirely, wheras i want to remove 1 option from the list collector. Many thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2019 01:52 AM
HI,
Is this on service portal or normal view.
Thanks,
Ashutosh