- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2025 01:16 PM
Hello,
I have created a catalog item with serveral sections containing checkboxes. What I want to archieve is that for each section it is mandatory to check at least one of the check boxes.
I came accross an old post https://www.servicenow.com/community/sacramento-snug/catalog-item-sleight-of-hand-mandatory-selectio... which states to set the label as mandatory with a UI Policy and the conditions been that the checkboxes are false.
However, this is not working for me. Can someone help me with a more updated solution to this issue? Thank you in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2025 12:32 PM
Hi @sola2 ,
You may try by creating a 2nd list in a Variable-Set & have a ui policy to control the visibility & mandatory requirement.
(1) Nothing selected
(2) Tier 1 Ministry Role selected
(3) Variable set for 2nd List
(4) UI Policy
Hope, this helps 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2025 01:55 PM
Hi, there are a few different ways you can accomplish this, and all of them rely on client scripts. Here's a very, very simple one that you can adjust, adding nested if's as required.
function onSubmit() {
//Type appropriate comment here, and begin script below
var box1 = g_form.getValue('boolean1');
var box2 = g_form.getValue('boolean2);
var box3 = g_form.getValue('boolean3');
if(box1== 'false' && box2 == 'false' && box3 == 'false'){
alert('Please select one of the three boxes.');
return false;
}
else{
return;
}
That being said, I'm unsure why the linked article's solution isn't working for you. I'd be happy to help if you'd like to pursue that solution instead. This is a silly idea, but does unchecking 'Reverse if false' change the behavior of your UI Policy?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2025 09:11 AM
Hello @Jon Hogland
I tried unchecking the reverse if false option but nothing happens
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2025 05:17 AM
Hi, did you try to implement the script I posted?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2025 09:42 PM
Hi @sola2
Just try this :
Catalog Item:
Label
checkbox1
checkbox2
checkbox3
*** make checkbox1 - mandatory
Sample: