Multiple Checkbox Variables in Service Catalog and Surveys

I just learned something new today about working with checkbox variables/questions in ServiceNow. Even though I’m probably one of the last people to figure this out, I’ll post it here so at least I can find the solution again when I need it!
ServiceNow allows you to set up variables or questions for use in data collection when working with Service Catalog or in Surveys. One of these variable types is the checkbox variable. The way that these variables works has always bothered me. The problem I’ve always had with them is that the system wants to group them all together and gives them a generic label of ‘Options’ when they are presented on the screen like this…

There are a couple of things I don’t like about this arrangement. First, the ‘Options’ label just looks bad. I’d really like to change that name to something else. Secondly, just because they follow each other in order doesn’t mean that I want to have all of those checkboxes grouped under a single question when presented on the screen. They might be asking completely different things. Well, it only took me 3 years but I’ve got a solution now that requires nothing more than a little bit of care in the arrangement of a few variables on your catalog item or survey. :)

The secret to this solution is simply to add a ‘Label’ variable immediately before the checkbox variables that you want to group on the form. The label groups any checkbox variables that follow it and it also overrides the generic ‘Options’ label that is shown normally. You can control this grouping by arranging the ‘Order’ values of your variables or questions as shown here…

An ordering as shown above in a catalog item would produce the following result…

If you have multiple groups of checkbox variables that you want to display immediately after one another you would need to set up 2 label variables, each followed by the checkbox variables that should be grouped underneath.

This concept works in exactly the same way with Survey questions.

Date Posted:

November 9, 2010

Share This:

15 Comments

  1. Abhiram Bharadwaj Diddigi October 3, 2011 at 2:38 am

    Hey, is there any way we can extend this so that the checkbox values can be pulled in from a table? I have been searching communities, wiki with no success :(

    Thanks mark !

    • Mark Stanger October 3, 2011 at 7:53 am

      I’m not aware of a way to pull the values from any other table than the default one in the system.

  2. Vineeth February 7, 2012 at 7:59 am

    I want a way in which if a survey is filled in by the user the response are stored in the survey response table. Is there a way in which i can make an entry in the survey response table to identify for which incident the response was given.

    • Mark Stanger February 7, 2012 at 8:04 am

      This linkage all happens for you if you use the task survey plugin. You can look on the wiki for more information. If you have additional questions you should ask them on the ServiceNow forums.

  3. Nicolas February 1, 2013 at 8:51 am

    THANK YOU!!!! It was a torture to find this out, i was trying almost everything (except this obvoiusly)

    • Mark Stanger February 1, 2013 at 10:12 am

      Thanks for the comment! I’m glad it helped you out.

  4. Lorene February 19, 2014 at 4:56 pm

    Thank you, I have a list of check boxes, with a label and if one of them is selected i want to display the associated options for that item. The issue I have is that the rendering, will break the list of check boxes even though the variables are hidden, is there any way of forcing the check boxes to be in one group regardless of hidden variables? and stop the break that is currently happening? Many thanks in advance for your time.

    • Mark Stanger February 20, 2014 at 8:09 am

      I don’t know of a specific fix for that issue. Checkboxes are notoriously difficult to do formatting around in the system. One option might be to consider a Yes/No choice list instead.

  5. Athi karthick May 15, 2014 at 4:57 pm

    Is there a way to remove the options label completely?
    We are racking our brain for the past 2 weeks over this..
    Thanks in advance

    • Mark Stanger May 15, 2014 at 6:24 pm

      Sure. To do that you would need to create your own ‘Label’ variable to override the standard ‘Options’ variable as I’ve described in this article. Once you’ve done that, you need to get the sys_id of the ‘Label’ variable and put it in code like this to hide the label. I’m not sure if this will work for survey labels but it should work there as well.

      $(‘label_IO:afd0ab042f306100aa45f67b91a189e4’).hide();

  6. Athi Karthick May 15, 2014 at 5:06 pm

    Thanks a lot anyway. This gives a good idea to proceed from here.
    Thanks again :)

  7. Dave Greene December 22, 2014 at 3:43 pm

    Can’t this functionality be used within an update set? Whenever I try it ends up showing the default “options” split out for each checkbox. I would like to use these checkboxes (grouped together) on multiple items.

    • Dave Greene December 22, 2014 at 3:44 pm

      I meant variable set not update set

  8. Nicole McCray February 1, 2016 at 9:54 am

    I am looking for a way to make a checkbox mandatory only if it become visible based on other field selections.

Comments are closed.

Categories

Tags

Loading

Fresh Content
Direct to Your Inbox

Just add your email and hit subscribe to stay informed.