which variable type allows mulitple selection

sohan_snow
Tera Contributor

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

find_real_file.png

Thanks in advance

1 ACCEPTED SOLUTION

Harish KM
Kilo Patron
Kilo Patron

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



find_real_file.png



find_real_file.png


Regards
Harish

View solution in original post

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

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


Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

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


Harish KM
Kilo Patron
Kilo Patron

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



find_real_file.png



find_real_file.png


Regards
Harish