To Boolean
Uncontrolled node
Overview
The To Boolean node converts any input value into a boolean (true/false) value. This is useful for normalizing data types before using them in conditional logic or when preparing data for APIs that require strict boolean values.
The node applies intelligent conversion rules:
- Booleans: Pass through unchanged
- Strings: Returns
falsefor empty strings,"false","undefined","null", or"0"(case-insensitive). Returnstruefor all other non-empty strings. - Numbers: Returns
falsefor0,truefor any other number (including negatives). - Objects/Arrays/Null: Returns
truefor any truthy value,falsefornull,undefined, or empty objects.
Inputs
| Input | Type | Description | Default |
|---|---|---|---|
| Value | Data | The value to convert to a boolean. Accepts any data type (text, number, boolean, object, null, etc.). | - |
Outputs
| Output | Type | Description |
|---|---|---|
| Boolean | Boolean | The boolean representation of the input value. |
Runtime Behavior
The node executes immediately when data is available at the input. No event trigger is required since this is an uncontrolled node.
Conversion follows these rules in order:
- If the input is already a boolean, it is returned as-is.
- If the input is a string, it is converted to lowercase and trimmed. If it matches
"false","undefined","null", or"0", the output isfalse. Otherwise, the output istrue(including for empty strings). - If the input is a number, the output is
falseonly if the value is exactly0. - For all other types (objects, arrays, etc.), a standard truthy check is performed.
Example
Converting a string flag to boolean:
- Input
value:"true"(text) - Output
boolean:true
Converting a numeric status:
- Input
value:0(number) - Output
boolean:false
Converting API response text:
- Input
value:"FALSE"(text) - Output
boolean:false(case-insensitive matching)
Checking if data exists:
- Input
value:[1, 2, 3](array) - Output
boolean:true