- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2025 09:30 PM
I have created a List collector Variable in Service Catalogue and created their 3 choices ( A , B , C) and get it referenced through question_choice table. Now the requirement is that when I select the B choice then I should not get the option to select C option and vice versa. But for Option A , I can select all 3 choice.
Please assist.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2025 01:12 AM
Hi @akchauhan
I have tried in PDI . Its working as expected . PFA code and screenshot for your reference.
Note:- I have used hardcoded sys_id of choices.
Explanation:
- Selection Rules:
- If B and C are both selected together, regardless of whether A is selected, the script triggers an alert and clears the List Collector value.
- Behavior:
- Users can select any single option or combinations like A + B or A + C.
- Users cannot select B and C together, even if A is included.
Testing:
- Test Cases:
- Select B and C → Alert should appear, and the value should clear.
- Select A and B or A and C → Selection should be allowed.
- Select A, B, and C → Alert should appear, and the value should clear.
- Select A only → Selection should be allowed.
Code :-
If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!
Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI
YouTube: https://www.youtube.com/@learnservicenowwithravi
LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2025 05:31 AM
Hope you are doing good.
Did my reply answer your question?
As per new community feature you can mark multiple responses as correct.
If my response helped please mark it correct as well 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-03-2025 01:12 AM
Hi @akchauhan
I have tried in PDI . Its working as expected . PFA code and screenshot for your reference.
Note:- I have used hardcoded sys_id of choices.
Explanation:
- Selection Rules:
- If B and C are both selected together, regardless of whether A is selected, the script triggers an alert and clears the List Collector value.
- Behavior:
- Users can select any single option or combinations like A + B or A + C.
- Users cannot select B and C together, even if A is included.
Testing:
- Test Cases:
- Select B and C → Alert should appear, and the value should clear.
- Select A and B or A and C → Selection should be allowed.
- Select A, B, and C → Alert should appear, and the value should clear.
- Select A only → Selection should be allowed.
Code :-
If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!
Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI
YouTube: https://www.youtube.com/@learnservicenowwithravi
LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2025 01:04 AM
Thank you ravi. I have been struggling with this requirement for quite some time. Your code really helped.