- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2025 09:21 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2025 09:27 PM
you cannot enforce minimum value in list collector without scripting.
So if you want user to select max 5 values then you will have to use onChange catalog client script and throw error to user if they cross that limit.
Something like this
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || !newValue) {
return;
}
var selectedValues = g_form.getValue('<list_collector_name>').toString().split(',');
if (selectedValues.length > 10) {
alert('You can select a maximum of 10 values.');
}
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2025 11:36 PM
usually it's recommended to keep it under 20 but no documentation says it
You can read more about it here:
- Limit values that can be entered on list collector variable
- does list collector has limits?
- How to limit the list collector choices selection
- Limiting Number of Selections in a List Collector
- Restrict the number of records selected in list collector
- How to increase the maximum size of a list collector?
- how to increase limit of list collector
Limiting Number of Selections in a List Collector
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2025 09:27 PM
you cannot enforce minimum value in list collector without scripting.
So if you want user to select max 5 values then you will have to use onChange catalog client script and throw error to user if they cross that limit.
Something like this
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || !newValue) {
return;
}
var selectedValues = g_form.getValue('<list_collector_name>').toString().split(',');
if (selectedValues.length > 10) {
alert('You can select a maximum of 10 values.');
}
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2025 11:25 PM
Thanks for your response.
I'm done with it.
And what is the default maximum number of the list collector?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2025 11:36 PM
usually it's recommended to keep it under 20 but no documentation says it
You can read more about it here:
- Limit values that can be entered on list collector variable
- does list collector has limits?
- How to limit the list collector choices selection
- Limiting Number of Selections in a List Collector
- Restrict the number of records selected in list collector
- How to increase the maximum size of a list collector?
- how to increase limit of list collector
Limiting Number of Selections in a List Collector
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader