Problem applying conditional to Boolean field

Button A changes a boolean field from “not selected” to “selected”.
I want Button A to only be visible if the boolean field is “not selected”.

Button B changes the same boolean field from “selected” to “not selected”
I want Button B to only be visible if the boolean field is “selected”

I set the conditional for Button A to visible “when boolean field is False”
and
I set the conditional for Button B to visible “when boolean field is True”

However, Button A does not satisfy the condition by default. It only displays if I change its visibility conditional to “when boolean field is empty”.

Then when I select it Button A disappears and Button B appears.

Then I select Button B which changes the Boolean to “False” causing Button B to disappear.

However, it does not cause Button A to re-appear again because (as you recall) the visibility condition on Button A is “when boolean field is emtpy”, which it is not. It is “False”.

How do i get Button A to display by default (when the boolean field is empty) AND also display when the boolean goes from “True” to “False”.

Don’t ever check for False in a condition, because you will fall into this trap. Booleans can have 3 states. Blank, False, and True. Normally once a boolean is checked and then unchecked, only then will it becomes False.

Instead only check for Checked or Not Checked, or as an alternative, you can check for True or Not True. But never check for False.

3 Likes

…unless you actually care about the difference between false and null :wink:

2 Likes

Thank you very much!

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.