Page 1 of 1

[Solution] Super simple Boolean routing question/challenge

Posted: Sat Jan 01, 2022 1:46 pm
by paddyrg
Hiya, I seem to be going around in circles with this one - boiled it down to a simple case I can't get past.

I have a variable boolean "ayesno" which is bound to a dynaform checkbox field then there's a routing rule depending on the result.

My routing rules are
Task2 --> @@ayesno == 1
Task1 --> @@ayesno == 0

In every case (removing spaces, trying 0, Flase, FALSE, false, "0", "false" etc, same for 1/True) the case proceeds to Task2 even where the checkbox is unchecked (that is when it doesn't throw a message about both routing cases evaluating to true or false when I tried "true" etc.). I'm sure it's simple, but I searched for samples and couldn't find any, so reaching out for ideas! Can someone point me in the right direction please?

Re: Super simple Boolean routing question/challenge

Posted: Sun Jan 02, 2022 9:09 pm
by Ironguts25
Checkbox values are stored in an array. Try this for your conditions:
Task1 --> in_array('0', @=ayesno)
Task2 -->in_array('1', @=ayesno)

That said, since this is a simple boolean condition why not just use a radio group control with variable data type of boolean?

Here's an example process (Email_Request_New_2012_04_20_16_01_16-6.pmx) attached in the following post, which includes returning the task to the originator based on selection of the radio control:
https://forum.processmaker.com/viewtopic.php?f=40&t=737679

Hope this is helpful.

Re: Super simple Boolean routing question/challenge

Posted: Mon Jan 03, 2022 2:55 pm
by paddyrg
OMG thank you! Radio buttons work a treat!

I always thought of checkboxes as the definitive simple boolean contol, so that's a huge help, thank you!

Re: [Solution] Super simple Boolean routing question/challenge

Posted: Tue Jul 25, 2023 9:27 pm
by cockroachdefine
These programs are crucial to the operation of ClearOS's email stack but are not publicly accessible via either the Marketplace or the web-based management interface.