# Switch

> Take a different path for each value.

Source: https://docs.buildcord.dev/nodes/conditions/switch/

`logic.switch` compares one value with a list of cases and leaves by the one it equals: one node instead of a chain of comparisons.

## Settings

| Setting | What it does |
| --- | --- |
| Value | What to look at, such as `{option.tier}`. |
| Cases | One per line. Each gets its own way out. |

## Ways out

- One per case, labelled with the case.
- `Anything else`, when the value equals none of them.

## Notes

- Text ignores capitals and spaces at either end; numbers compare as numbers, so `5` matches `5.0`.
- The first case that matches wins.
- In the blueprint each case leads out by `case:` and the case in lowercase, with dashes for anything else: "Gold tier" is `case:gold-tier`.

## Example

A `/role` command with a text option **colour** and cases `red`, `green` and `blue`, each wired to its own [Add role](https://docs.buildcord.dev/nodes/members/add-role).

## Related

- [Comparison](https://docs.buildcord.dev/nodes/conditions/comparison)
- [Weighted pick](https://docs.buildcord.dev/nodes/conditions/weighted-pick)
