FlowmageDocs

Switch

Routes the flow to one of many paths, by the value it matches.

Settings

SettingWhat it is
Value to look atRequiredCompared to each case's value exactly — a number never matches text.
CasesOne port per case, matched in order. Anything that matches no case leaves by the else port.
Compare textWhether "Paid" and "paid" count as the same text. Numbers are not affected.
Technical details
KeyValue
expressiontext
caseslist of {id: text, label?: text, value: any JSON}, by default []
compare"exact" or "ignoreCase", by default "exact"

Output

What this node gives depends on the data it gets.

Sample output, and the expression for each field

Errors

When a step of this node stops a run, the run page shows a code. Look it up:

Example step

The step as a flow file holds it. Replace each value in <…>.

{
  "config": {
    "cases": [],
    "compare": "exact",
    "expression": "<value to look at>"
  },
  "label": "Switch",
  "type": "core.switch",
  "version": 2
}

Older versions

A flow that already has this version keeps running it. A new step always gets the newest.

Version 1
SettingWhat it is
Value to look atRequiredCompared to each case's value exactly — a number never matches text.
CasesOne port per case, matched in order. Anything that matches no case leaves by the else port.
Technical details
KeyValue
expressiontext
caseslist of {id: text, label?: text, value: any JSON}, by default []