Allowing Only One Checkbox Selection

This seems incredibly easy, but I can’t solve it using the nodes to create a Data Directive, and it’s been too long since I’ve had to write any code. All I want to do is add a Data Directive to the QuoteHed table that will only allow a user to select one of 4 checkboxes. If more than 1 is selected, I would like to Raise an Exception.

Hi alex,
Why don’t you change them to Radio Buttons and then you get that functionality for “Free”
Regardless in a BPM / Data Directive what I would do is set a condition check for each CheckBox and keept a “sum” in a variable
Declare a integer variable Count=0;
And then for ach Condition if ChecBox01 = true then Add 1 to count
At the very end check and if Count > 1 then Error.

This is without writing any code. If you want to write code there are simpler ways.

Hesitant to change to radio buttons because data has already been stored under the Checkbox 1,2,3, and 4 fields. This could make it difficult for future reporting.

As far as the variable count, I did attempt this but with 4 checkboxes it gets very messy. After testing the first checkbox, you must proceed from the true or false end of the condition node. You can also connect only one node to each end. This means I am unable to account for all of the possible true/false combinations of the 4 checkboxes.

Not sure if that makes complete sense, it’s difficult to explain through text.

Don’t worry about the combinations.
Put 1 condition that just checks for CheckBox1 IF True Add 1 to Variable and continue to Condition 2 If False Also continue to condition 2… then repeat… at the VERY Last condition check the Value of Count.

I’m still at a loss. I understand what you’re proposing and it is what I originally attempted before posing here, it just doesn’t make sense when trying to create the Directive.

If you could create an example I would really appreciate it because I don’t think this would work the way I need it to! The radio button approach makes the most sense, but I’m sure it would cause reporting issues in the near future.

Here you go
Declare Count Variable
http://jcg.pictures/gdgfCUBJbjaig.png
Set Count to 0
http://jcg.pictures/gdgfCUL2jdll.png
Check of CheckBox X is True
http://jcg.pictures/gdgfCUOhdhKW.png
If True Add 1 to Count Then Continue to Next Condition
http://jcg.pictures/gdgfCUTicUN2.png
If False Just Continue to Next Condition
http://jcg.pictures/gdgfCUYiitIgf.png
If True Add 1 to Count
http://jcg.pictures/gdgfCU3zghfig.png
Etc…
Repeat the above for each CheckBox

If Count > 1 then Yelll…
http://jcg.pictures/gdgfCUgdhhjdifgd.png

3 Likes

Wow okay. I wasn’t thinking about connecting both the set argument/variable and the false side of the condition node to the same next condition. My apologies.

Also realized I can just use radio buttons and bind them to the checkbox fields… I appreciate your help, thank you!

Hi Jose,
Would it be possible to add this pictures again? Thanks

Hi Luis, I do’nt have them any more odd it normally downloads the images so if the links expire this doesn’t happen.
What is it you are trying to do? Same thing?

It may be off topic. I’m trying to figure out how Radio Buttons work in a Dashboard Tracker. Basically I want to be able to filter JobHead.JobRelease for True, False or Both Conditions. I have a calculated field that has two outputs: YB or NB.
I already make it work using a Text Field in the Tracker. You type Y% and get true, N% and get false, and %B and get both.
I want to use a GroupBox with 3 Radio Buttons. Each of these buttons with the conditions above (Y%, N% or %B). Then depending on which Radio Button you select, affect the Text Box that is filtering the BAQ.

Idea

I have found that when you want to filter by a boolean value, (True, False, or “either one”) it is easiest to create a calculated field in the BAQ that is TEXT with the words “True” and “False” or “Yes”, “No”… THEN in the dashboard filter on that text field. You can create a COMBO box that has the two values… if you leave the combo blank, then it doesn’t filter at all. This way, I can have the dashboard ask “Firm Jobs?” with the combo… and if they choose “Yes” it only shows firm jobs, “No” does not show firm jobs, and blank shows ALL jobs.

1 Like

They don’t work in a dashboard tracker. Only in customizations.

Thank you Tim, it sounds easier compared to what I was planning to do. Is “blank” an option on the dropdown, or something the user needs to clear to search for both Yes/No?

I’m fairly new to Dashboards, could you take a look on my setup? The ones in red are the fields I set. I’m curious if I missed something.
Thanks Again.

I use the textbox method with a calculated “YNB” field. And you don’t have enter the wildcard characters.

Just use the “Matches” condition on the dashboard’s tracker.

image

And as a bonus, you don’t even have to enter “B” for both. Because a blank value means to ignore the condition altogether.

blank “Inactive” tracker field results in both “YB” and “NB” results

I tried that first. For some reason I couldn’t make it work without the Wildcard. I imported the Dashboard you are showing in the pictures from a different Post from you, and I needed the wildcard as well. Thanks for Sharing.