How to add list collector to the form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2022 09:41 AM
Hello
Can anyone explain me, ow to add a list collector to a form
Thanks in advance
- Labels:
-
Request Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2022 11:41 PM
HI,
please follow the below link:
https://www.covestic.com/blog/servicenow-tips-making-list-collectors-useful/
Hope this helps.
please mark my answer as ✅ Correct & Helpful based on the validations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2023 06:06 AM - edited ‎03-20-2023 12:59 PM
@Sweety11 wrote:Hello
Can anyone explain me, ow to add a list collector to a form
Thanks in advance
List collector variables are a great way (currently the only way) to allow a user to select multiple options from a referenced table in a single variable on a service catalog item. The list collector variable allows you to choose from one to many (potentially hundreds or more) selections. What if you wanted to limit the number of items like my hair transplant turkey list goes long that a user could select? This script does exactly that. It restricts the selected items list on a list collector variable to whatever amount you choose. Just use the catalog client script below and set the variables for the maximum number of selections and the name of the variable to apply the restriction to.
Name: Limit Selections
Type: onChange
UI type: Desktop
Script:
//Limit the number of selected options in a list collector
//Specify the max options and variable name below
var maxOptions = 5;
var varName = 'users';
var leftBucket = gel(varName + '_select_0');
var rightBucket = gel(varName + '_select_1');
var selectedOptions = rightBucket.options;
if(selectedOptions.length > maxOptions){
//Move any options with IDs greater than maxOptions back to left bucket
var selectedIDs = [];
var index = 0;
for(var i = maxOptions; i < selectedOptions.length; i++){
selectedIDs[index] = i;
index++;
}
//Move options and sort the left bucket
moveSelectedOptions(selectedIDs, rightBucket, leftBucket, '--None--');
sortSelect(leftBucket);
alert('You cannot select more than ' + maxOptions + ' options.');
}
}