Get startedGet started for free

Switch: routing by status

1. Switch: routing by status

You can build any routing logic with nested Conditions — and you shouldn't. Two levels deep, Switch becomes the better tool. This video covers wiring its cases and the single most important slot: Default, without which an unrecognized value falls through silently.

2. Nested Conditions vs Switch

Conditions and Switch overlap in what they can express but differ in how they read. A Condition splits the flow on a boolean, yes or no, and nesting more than two of them produces a diagram nobody wants to debug. Switch takes one value and routes it to one of many cases based on exact match. Active, Lapsed, and Renewed. Three statuses, three cases, all at the same level. The shape is flat instead of triangular. When you find yourself writing a third nested Condition on the same field, that's Switch's cue.

3. Anatomy of a Switch

A Switch has three parts. The On field is the value being evaluated, usually one column from a row inside Apply to Each. For a SharePoint Choice column like Status, you pick the Status Value token from dynamic content. The Case slots each carry an exact-match string and a branch of actions that runs when the On value equals that case. There are no operators on a Switch. No greater-than, no contains, just equality. And finally there's the Default case, which runs when none of the cases match. The whole action is flatter, more scannable, and far easier to extend than the equivalent chain of Conditions.

4. Cases match exactly: case-sensitivity bites

Switch matches by strict equality. That means Active and active are not equal, and Active with a trailing space is not equal to Active without one. If the source data is messy, with strings coming from a free-text field or a CSV upload, the case-sensitive comparison will route values to Default that you expected to match a case. The fix lives upstream. Coerce to lowercase with `toLower()`, trim whitespace with `trim()`, or make sure your case values exactly match the display labels the source system uses. SharePoint Choice columns are reliable because the display values are controlled by the list administrator, so what you type in the case slot must match what you see in the column settings.

5. Why Default is non-negotiable

A Switch with no Default and an unmatched value is the silent-failure pattern at its purest. Every case evaluates, none matches, the Switch completes, and the run is marked green. Nothing was actually done for that record, but nothing complains either. Add a Default case that logs the unexpected value, such as a Compose action that captures the offending value, or a Create item that writes it to a SharePoint exceptions list, and silent fall-through turns into a visible signal. Next time the source system invents a new status, you'll find out about it the same day.

6. Let's practice!

Time to replace nested Conditions with a Switch and add a Default.

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.