Multiple Checkbox Variables in Service Catalog and Surveys

//Multiple Checkbox Variables in Service Catalog and Surveys

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.

By | 2018-07-09T15:00:05+00:00 November 9th, 2010|Categories: System Definition|Tags: , , , |15 Comments

About the Author:

Mark has worked in the IT industry since 2002 and with ServiceNow since 2007. He is the founder and creator of SN | Guru and the co-founder of Crossfuze, one of the worlds leading ServiceNow consulting partners. Prior to co-founding Crossfuze, he worked for ServiceNow as a Senior Architect on the Professional Services team. He has personally led dozens of successful implementations encompassing every part of the ServiceNow platform. He is also responsible for designing and developing groundbreaking ServiceNow solutions and best practices in the form of various applications, turnkey solutions, and integrations during his tenure at ServiceNow, Crossfuze and, of course, SN | Guru. These solutions are used today by ServiceNow administrators and consultants alike in hundreds of ServiceNow instances around the world!

15 Comments

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

    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 - Reply

      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 - Reply

    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 - Reply

      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 - Reply

    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 - Reply

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

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

    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 - Reply

      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 - Reply

    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 - Reply

      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 - Reply

    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 - Reply

    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.

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

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

Leave A Comment