Skip to content

If/Else

The If/Else node evaluates a condition expression and splits data into two branches: rows that match go to the true output, and rows that do not match go to the false output.

Configuration

PropertyTypeDefaultDescription
conditionstring--Required. An expression to evaluate per row (e.g., row.status == 'active').

Input

Accepts either:

  • An array of rows -- the condition is evaluated per row, splitting them into two groups.
  • A single object (associative array) -- the condition is evaluated once; the object passes through or is replaced with an empty array.

Output

Returns an object with branching metadata:

json
{
  "_true": [/* rows that matched */],
  "_false": [/* rows that did not match */],
  "_branching": true
}

For a single object input, returns the object if the condition is true, or an empty array if false.

Expression Context

Inside the condition expression, the following variables are available:

VariableDescription
rowThe current row being evaluated
inputSame as row for single-object input

Example Conditions

ConditionMeaning
row.status == 'active'Rows where status is "active"
row.price > 100Rows where price exceeds 100
row.email != ''Rows with a non-empty email
row.quantity > 0 and row.status == 'in_stock'Rows in stock with quantity
'admin' in row.rolesRows where roles array contains "admin"
row.title matches '/^[A-Z]/'Rows where title starts with uppercase

Example Use Cases

Show active vs. inactive items

condition: "row.status == 'active'"

Active items flow to one output branch (e.g., a green-styled repeater), inactive items flow to another (e.g., a grey-styled list).

Gate content by user role

Use with Current User as input:

condition: "'subscriber' in row.roles or 'administrator' in row.roles"

Conditional email sending

In an action pipeline, use If/Else to decide whether to send a notification:

condition: "row.priority == 'high'"

Only high-priority submissions get routed to the Send Email node.

TIP

For multi-way branching (more than two paths), use the Switch node instead.