Flow reference: Logic

Switch

Branch on a value with up to four cases.

Branch on a value with up to four cases.

When and how to use it

Connect the input from the preceding step on the path that should perform this operation.
Fill the fields with data available in the trigger's context.
Connect the needed outputs; an unconnected path cannot run later blocks.

Configuration fields

Value to test — value


The value to store, compare or process. Use the required type and a variable only after the source block has run.

Input: Text with variable suggestions.

Default: ``.


Case 1 — case1


Value matched by the first switch branch. Connect case1 to its intended action.

Input: Text with variable suggestions.

Default: ``.


Case 2 — case2


Value matched by the second switch branch. Keep case values distinct.

Input: Text with variable suggestions.

Default: ``.


Case 3 — case3


Value matched by the third switch branch. Leave unused cases according to the editor's behavior.

Input: Text with variable suggestions.

Default: ``.


Case 4 — case4


Value matched by the fourth switch branch. Also connect the default path for an unmatched value.

Input: Text with variable suggestions.

Default: ``.

Outputs and next steps

case1: The value matched case 1.
case2: The value matched case 2.
case3: The value matched case 3.
case4: The value matched case 4.
default: No switch case matched.

Test and troubleshoot

Invoke the correct trigger with simple inputs and verify the expected effect. Confirm variables exist on this path. A preview alone does not verify Discord delivery.

Save, validate and publish. Perform one real test and read the first relevant log error. [Testing](/docs/flow-testing) · [Variables](/docs/flow-variables) · [Permissions](/docs/flow-permissions).