# Switch

Send the run to one of several cases by one value.

## Do things in Switch

Add a **Switch** step. Choose the row to see all its fields.

- [Switch](https://docs.gorunner.io/apps/switch#fields-f-evaluate): Route execution to the case whose value matches the input value.

Later steps read a step’s output by its name: see [Use data from earlier steps](https://docs.gorunner.io/build/use-data-from-earlier-steps).

Not in your list? See [When an app isn’t here](https://docs.gorunner.io/apps/when-an-app-isnt-here#q-not-in-list).

## For developers

In the API, which calls apps pieces, Switch is `pieceId: "switch"` with `actionId: "evaluate"`. [Get an app](https://docs.gorunner.io/api/apps/get-app) returns every field.

It computes from its inputs only (`pure`). See [How versions and side effects work](https://docs.gorunner.io/apps#q-versions).

### Switch › Switch

Route execution to the case whose value matches the input value.

- **Value to match · Optional**: Expression whose resolved value selects the case, such as {{trigger.body.status}}.
- **Cases · Required**: One arm per case value; unmatched values fall through to Otherwise. With no Otherwise arm, no arm is taken for an unmatched value.
- **Execution Mode · Optional**: Choose how a case is picked when the value matches; "First matching case" runs only the first match. Options: First matching case. Default: First matching case.

Source: https://docs.gorunner.io/apps/switch
