Smart Switch
AI-generatedSummary
Evaluate multiple user-defined conditions against each input item's JSON data, routing the item into dedicated true/false output branches per condition.
Inputs
- conditions (required) — An array of conditions, each with a name (optional), a JSON field or expression to extract, an operator to compare, and a value where applicable. Each condition defines two output branches: one for when the condition is true, another for false.
- options — Advanced options including case-insensitive comparison and whether to include detailed evaluation debug information in each output item.
Output shape
Multiple output branches, two per condition defined: one branch with items for which the condition evaluated to true, another branch for false evaluation; each output item contains the original JSON plus an optional debug object.
The number of outputs is twice the number of conditions. Items are duplicated across these output branches according to condition evaluations. When enabled, a _smartSwitch debug field includes condition name, branch outcome, evaluated values and whether it passed. The output preserves the original input item's JSON and pairing index.
Examples
Example 1: Input items with various properties, conditions defined for specific fields using operators like equal, exists, contains.
Two conditions defined: 'Field A equals 5' and 'Field B exists'. Correspondingly, four output branches: 'Field A equals 5 true', 'Field A equals 5 false', 'Field B exists true', 'Field B exists false'. Each input item routed into one true or false branch per condition.