- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2022 11:38 PM
I have a catalog item with multiple groups of label+checkboxes. Is there a way to make the user check at least one of the boxes in any of the groups? This is easy when we have only one group, but it is possible to make a UI policy that will work across the groups?
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2022 11:20 PM
Hi,
you will have to use onSubmit catalog client script and verify that
function onSubmit() {
var value1 = g_form.getValue('variable_1');
var value2 = g_form.getValue('variable_2');
var value3 = g_form.getValue('variable_3');
var value4 = g_form.getValue('variable_4');
var value5 = g_form.getValue('variable_5');
var value6 = g_form.getValue('variable_6');
var value7 = g_form.getValue('variable_7');
if(!value1 && !value2 && !value3 && !value3 && !value4 && !value5 && !value6 && !value7) {
g_form.addErrorMessage("Please select at least 1 variabel");
return false;
}
return true;
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2022 12:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2022 12:37 AM
That will not work, because that will require at least one checked box in each group.
My requirement is that at least one of the boxes on the whole cat item is checked. Many groups can be unanswered, as long as there is at least one checked box in one of the other groups.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2022 10:19 PM
You can write OnSubmit() client script and restrict the form submission by validating the checkboxes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2022 10:26 PM
Hi
For Service Portal (as of Quebec), the best way to make at least one checkbox mandatory in a group of checkbox variables is to add a Label that appears in order immediately prior to the checkbox variables, and then make the first checkbox variable mandatory.
The grouping and mandatory settings will ensure that at least one checkbox is selected
Service Portal will treat the group as a single set and will ensure that the user selects at least one checkbox.
Please try this and this will work for you surely.
Please mark my answer as correct if this solves your issues!
If it helped you in any way then please mark helpful!
Thanks and regards,
Kartik