Boolean package guide
Set, compare, flip and convert true/false values.
Version 2.17.1. Installed versions can differ. Examples are illustrative and not tested.
Prerequisites
The actions run on the Device and need no other application or session. result → x means: save the output in variable x.
Type true or false in lowercase, or use a Boolean variable such as $flag$. TRUE, 1 and yes do not work. Convert a String or Number variable first, also a String that contains true. An empty Boolean field means false. All fields are optional. A value you type must be the correct type, also in a field the action does not use.
A small flow: set Boolean variable ready with Assign (source=constant, userDefined=true). Use $ready$ in Boolean condition with operator=EQ and value=true to take the true branch. Use To string when another action needs the text true.
Boolean inputs
| ID | Editor field | Type; default | Use |
|---|---|---|---|
source | Select the first boolean variable / Select boolean variable / Select the boolean variable to be inverted | Booleandefault false | First or only Boolean. |
check | Select the second boolean variable | Booleandefault false | Second Boolean. |
Actions
Assign (booleanAssign)
Copy the selected Boolean constant or value.
Inputs
| ID | Editor field | Type; default | Use |
|---|---|---|---|
source | Select the source boolean variable/ value | Sourcedefault constant | constant uses user; variable uses bool. |
user | userDefined | Booleandefault false | A true/false switch. Used when source=. |
bool | boolVar | Booleandefault false | A Boolean value or variable. Used when source=. |
Outputs
| ID | Type | Meaning |
|---|---|---|
result | Boolean | Selected Boolean value. |
Example
Prepare Boolean variable flag with false. Set source=constant, userDefined=true, and boolVar=$flag$. result → assigned.
Expected result
assigned is true. Change only source to variable and it is false. The field you did not pick is ignored.
Compare to (booleanCompareTo)
Order two Booleans: false is less than true. The result is a Number.
Inputs
Uses the Boolean inputs: source, checkSource.
Outputs
| ID | Type | Meaning |
|---|---|---|
result | Number | 1 if the first is true and the second is false, -1 for the reverse, 0 if equal. |
Example
Set source=true and checkSource=false. result → comparison.
Expected result
comparison is 1.
Equal to (booleanEqualTo)
Save whether two Boolean values are equal.
Inputs
Uses the Boolean inputs: source, checkSource.
Outputs
| ID | Type | Meaning |
|---|---|---|
result | Boolean | True for equal inputs and false for different inputs. |
Example
Set source=true and checkSource=true. result → same.
Expected result
same is true. Two false inputs also give true. One true input and one false input give false.
Invert (booleanInvert)
Return the opposite Boolean. The source changes only if you save the output back to it.
Inputs
Uses the Boolean inputs: source.
Outputs
| ID | Type | Meaning |
|---|---|---|
result | Boolean | Logical inverse of the input. |
Example
Prepare Boolean variable flag with true. Set source=$flag$. Save result as another Boolean variable opposite.
Expected result
opposite is false and flag stays true. A false source returns true.
To number (booleanToNumber)
Convert a Boolean to 1 or 0 for a numeric field or calculation.
Inputs
Uses the Boolean inputs: source.
Outputs
| ID | Type | Meaning |
|---|---|---|
result | Number | Number 1 for true or 0 for false. |
Example
Set source=true. result → numericFlag.
Expected result
numericFlag is 1. With source=false, it is 0.
To string (booleanToString)
Convert a Boolean to lowercase text for a text field or String template.
Inputs
Uses the Boolean inputs: source.
Outputs
| ID | Type | Meaning |
|---|---|---|
result | String | String true or false. |
Example
Set source=false. result → flagText.
Expected result
flagText contains the String false. With source=true, it contains the String true.
Conditions
Boolean condition (booleanCondition)
Compare two Boolean values in an If step. Both sides accept Boolean variables.
Inputs
| ID | Editor field | Type; default | Use |
|---|---|---|---|
variable | Boolean variable | Booleandefault false | Boolean value. |
operator | Operator | Operatordefault EQ | EQ (Equals to (=)) tests equality. NEQ (Not equal to (≠)) tests inequality. |
value | Value | Booleandefault false | Second Boolean, such as $other$, true or false. |
Outputs
No outputs. Use it in an If step.
Example
Prepare Boolean variables flag=true and other=true. Set variable=$flag$, operator=EQ (Equals to (=)), and value=$other$.
Expected result
The condition evaluates to true. Change operator to NEQ and it evaluates to false. With variable=$flag$, operator=NEQ, and typed value=false, it evaluates to true.