Skip to main content

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 false for empty strings, "false", "undefined", "null", or "0" (case-insensitive). Returns true for all other non-empty strings.
  • Numbers: Returns false for 0, true for any other number (including negatives).
  • Objects/Arrays/Null: Returns true for any truthy value, false for null, undefined, or empty objects.

Inputs

InputTypeDescriptionDefault
ValueDataThe value to convert to a boolean. Accepts any data type (text, number, boolean, object, null, etc.).-

Outputs

OutputTypeDescription
BooleanBooleanThe 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:

  1. If the input is already a boolean, it is returned as-is.
  2. If the input is a string, it is converted to lowercase and trimmed. If it matches "false", "undefined", "null", or "0", the output is false. Otherwise, the output is true (including for empty strings).
  3. If the input is a number, the output is false only if the value is exactly 0.
  4. 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