List collector validation and restrictions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2025 12:52 AM
Hi Experts,
I have a list collector type variable that refers to the cmdb_ci.
I have a custom choice field in the cmdb_ci which has choices let's say A,B,C and D.
If the user first select a CI in the list collector and the choice value of that CI is A then the next selections should be only of Choice A, if they select the presiding CI's related to any other choices then it must throw some kind of error or info message.
I also want to restrict the list collector selection to max 5 values.
Kindly assist on this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2025 01:50 AM
you will have to use onChange catalog client script for this.
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
01-23-2025 01:55 AM
this would be tricky to handle as it's a list collector and it allows multiple selection.
What if user selects 2-3 CIs with different Choices like A, B and C
What will you do in this case?
To overcome this is the solution and will make your job and user's job easier
1) Have a reference variable to cmdb_ci
2) then have another list collector to cmdb_ci which allows them to select additional CIs and add this ref qualifier so that they select additional CIs based on 1st one
Advanced ref qualifier
javascript: 'sys_id!=' + current.variables.1stVariableName + '^choiceField=' + current.variables.1stVariableName.choiceField;
In variable attributes of list collector use this
ref_qual_elements=1stVariableName
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
01-24-2025 12:59 AM
Hope you are doing good.
Did my reply answer your question?
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
02-24-2025 02:09 AM
Hope you are doing good.
Did my reply answer your question?
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