What is the value of a checked checkbox and why doesn't it seem to populate a variable?

Thommango shared this question 6 years ago
Answered

I want to control work flow based on some checkboxes. I am getting stuck and it seems to be because checkboxes are not working as I would expect. When I drag a checkbox to a variable and then display the variable on a subsequent page, the variable appears to be empty and the text reads "Label" still. I have been able to do exactly what I want when I start with text fields and force the user to right "Yes" in the fields, but that's just going to make me look stupid. If I'm asking binary questions, I want to use a checkbox. I would have expected that a checkbox populates the variable with True/False or 1/0, or maybe with "Checked" or "Is Checked" but since the variable has no value, none of these seem to be right answer. So, what am I missing here about idiosyncrasies of using checkboxes to populate variables?

Comments (11)

photo
1

Now you can only populate checkboxes with the value of a variable if it's true/false. Next week you will be able to populate labels too. Meanwhile as a workaround you can place a hidden checkbox, populate it with the variable and then populate the label depending on the hidden checkbox.

photo
1

Okay, but I was only using the labels to debug things. What I'm really trying to do is:


1) use a checkbox to set a variable's value


2) use the variable's value later to make a conditional flow.


I can do this perfectly when I use text entry fields instead of checkboxes. The user types "Yes" in response to each of the yes/no questions on my set up page and then later I look to see that the value for the variables is not false to determine the work flow. But when I use checkboxes instead of text fields, either the variables are not getting populated or there's something about how I'm supposed to ask the conditional flow to evaluate the value of the variable that I'm not understanding.

photo
1

Well the awkward thing is you can't use the variable's value in the conditions if that variable holds a boolean value (that's why it's already changed on the update we launch next week). So you have to set the value of that variable into a checkbox and then use that checkbox on your condition.

photo
1

Wow, that is awkward. I spent several hours trying to figure this one out. I wish I could have avoided this blind alley.

photo
1

Just lost another hour trying to figure out another little nuance: When you drag the checkbox onto the variable, it creates an event for page unload, which is great. But it doesn't specify that the value you want to add to the variable is the "is checked" value. I'm not sure what other value you might want to capture from a checkbox, so it was really not obvious to me that I need to manually open up the event and add this detail. So here are two suggestions:


1) By default, dragging a checkbox over a variable should use the "is checked" attribute as the source of the value being applied to the variable.


2) If a set value event doesn't actually specify the value that should be set, the user should be made aware that the event is incomplete.

photo
1

It's already fixed for the next update. Thanks.

photo
1

So.... damn this is annoying. I have a similar situation....


I have a checkbox of 6 items. They correspond to 6 different topics.


If I click on Checkbox 1, i want the submit button to go to the corresponding section. If I don't click on Checkbox 1, I want the submit button to go to the next section that was checked out of the 6.


This process then needs to get repeated on page 2. If the check box corresponding to pg. 3 was checked it should go there, etc...


I have been experimenting with adding different 1/0 variables to the checkboxes when clicked, when page is loaded, etc... but having no luck to get the page to move as I want it to. Thoughts?

photo
1

Are you using individual check boxes or a checbox list widget?

photo
1

Do I need to group them or something? I was using the checkboxes from the Twitter Bootstrap widgets

photo
1

Why would that even matter? First of all, it is a "Check All That Apply" type question. Second, the pages that correspond with each checkbox are all separated.

photo
1

Let me see if I understand it correctly. So you have a screen with a checkbox widget (and you used the one in the Twitter bootstrap library) and then you have a button in that same screen. You need that button to go to one screen if the checkbox is checked and to a different one when is not checked. Is that what you want? If that's the case, then you don't need variables. Just define a conditional link and, in the condition, use the checkbox. But be careful to drag the checkbox to the condition, not the check box label. Dragging the checkbox from the Outline view inside the expression builder is easier in these cases. If you want to know how to build a conditional link take a look at this tutorial: http://www.justinmind.com/prototyper/...


If you think I still don't get want you want, if you don't mind, send your prototype (or an example of what you want to do) to jim.support at justinmind.com and we will give you a hand.