I have a Service Catalog item in ServiceNow (Geneva release) that personnel use to request access to additional ServiceNow groups. A list collector displays the all of the groups available. We want to limit it and disallow a few choices from appearing. When you build a List Collector variable, you can specify a List table, but you cannot construct a filter on it.
Is it possible to use a Catalog Client Script to check each item being loaded into the List Collector and skip it, perhaps by checking sysID or another value? I assume a glide record call is being done somewhere in order to populate the list collector, but I'm unsure how to modify it or interrupt it.
For this example, the List Collector is named 'bucket'.
I can probably try to start with:
var lcFilter = g_form.getControl('bucket')
There is probably a way to manipulate the contents from that object. I just need help figuring out what part of the object I need to manipulate. We currently use a similar function to rename the headers of the List Collector like this:
var headers = g_form.getControl('bucket').parentElement.querySelectorAll('.col-xs-4');
headers[0].childNodes[0].firstChild.data = 'All Available Groups';
headers[1].childNodes[0]firstChild.data = 'Groups you wish to add';
You may want to try a solution that allows you to directly apply a filter to your list collector that I've used from http://www.servicenowguru.com/scripting/client-scripts-scripting/changing-filter-list-collector-variable-client-script/
The code below is a copy and paste from there, so I don't take too much credit, but you want to put your list collector name here
Then an encoded query here to filter it on.
This would be in a
Catalog Client Script
for onLoad