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.
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 !
I’m not aware of a way to pull the values from any other table than the default one in the system.
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.
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.
THANK YOU!!!! It was a torture to find this out, i was trying almost everything (except this obvoiusly)
Thanks for the comment! I’m glad it helped you out.
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.
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.
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
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();
Thanks a lot anyway. This gives a good idea to proceed from here.
Thanks again 🙂
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.
I meant variable set not update set
nevermind…just answered my own question…it’s an issue with the Eureka patch I’m on
https://community.servicenow.com/thread/174088
I am looking for a way to make a checkbox mandatory only if it become visible based on other field selections.