- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2017 05:07 AM
Hi All,
In a catalog item, i need to use a variable that will have multiple choice values and should also allow multiple selection. Also, this variable should be mandatory(i.e atleast 1 option to be selected before the request is placed).
I am able to achieve it via a series of checkboxes but not getting how can I make the selection of any 1 checkbox mandatory before the submission (i.e users are able to submit the form without selecting the checkboxes)
Is there any other alternative to achieve the same
Thanks in advance
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2017 05:15 AM
When you create a check box variable. you have a check box called selection required. Make that true. So that your all the multiple choices will be mandatory. i.e they shud select atleast one
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2017 05:10 AM
You might find this helpful Sohan.
https://www.servicenowguru.com/scripting/client-scripts-scripting/checkbox-variables-mandatory/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2017 05:13 AM
Hi Sohan,
I would recommend to use List Collector as variable which allows multiple selection. This is similar to reference field which refers to table and user can select more than 1 value.
Approach would be: have a custom table, add column as Options with string length 80 or 100. have 3 records i.e. each record having options column populated as colour, budget and image
create list collector variable and select this table as lookup. user can then select more than 1 value.
To check for mandatory you will have to write onsubmit catalog client script and get values from this variable and check if value is empty or not.
if atleast 1 value is selected then it will give you sys_id of that record selected.
onchange script on list collector doesn't work so onsubmit is used.
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
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
‎11-06-2017 08:29 PM
hi ankur, thanks for your help, I was looking for a solution doesn't would involve creating a custom table. however, your suggestion seems to be a very good one were variables would need to be continuously added\removed from a catalog item. I do have one such catalog item, may be I can try your suggestion on that catalog item
thank you so much

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2017 05:15 AM