
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2020 09:16 AM
I have a record producer with a list collecter and I and need to change the selected options depending on the value of a drop-down list on the same record producer.
I have tried the script listed here https://www.servicenowguru.com/scripting/client-scripts-scripting/move-list-collector-options/ as a catalog client script, but this is not working.
I have inserted some jslog entries into the script and it seems to fail at
var leftBucket = gel(varName + '_select_0');
The idea is to use a list collecter to create a task for each entry in the list collector. The drop-down provide a list of standard tasks for a set option then the list collector can be used to add or remove should it need to be customized.
Fairly new to SN development so go easy. I can, however, do some simple JS coding.
Thanks
Ray
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2020 10:08 AM
So, to be clear, you want to change the options that have been selected (moved to the right) based on some other form change? You can do this using g_form.setValue() but list collectors have a little twist; you need to supply a comma separated string of sys_id's that match the records displayed in the list collector.
For example, say you have a list collector named "list" that references sys_user and you want to auto-populate two names in the list. You would find the sys_id's of the users and then do this:
//List of sys_ids for users:
var sys_users = '62826bf03710200044e0bfc8bcbe5df1,a8f98bb0eb32010045e1a5115206fe3a'
//set the values in the list collector
g_form.setValue('list', sys_users);
and there you go:
If this was helpful or correct, please be kind and remember to click appropriately!
Michael Jones - Cloudpires
Michael D. Jones
Proud member of the GlideFast Consulting Team!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 04:54 AM
Make sure you are passing in the sys_id's of the records you would select in the list collector and that you are using the correct field name.
If you want to check what values you should be passing, add an onchange for your list collector and alert g_form.getValue('your_field_name')
to see what the string should look like.
Michael D. Jones
Proud member of the GlideFast Consulting Team!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2025 08:09 PM