---
title: "switch · RUAL Documentation"
description: "Returns a condition based on the given expression."
canonical: https://docs.rual.nl/block-types/condition/condition_switch
language: en
---

# switch

This block is part of the [`condition`](https://docs.rual.nl/block-types/condition) group and was last modified in core [`v12.0.4`](https://docs.rual.nl/core-versions/120004).

Returns a condition based on the given expression.

- expression required `value` The expression to evaluate.

- default `condition` The default statement to be executed.

- output `condition` Returns the condition matching the expression.

- match `condition` Returns true in case a match was found.

Matches the string on the value pin against the case states by exact, case-sensitive comparison. On a match: condition outputs whether that case's pin is exactly boolean true, and matched outputs true. On no match: matched is false and condition is the default pin's value when that value is truthy, otherwise nil. A falsy or non-string value never matches any case.

A typical wiring for [switch](https://docs.rual.nl/block-types/condition/condition_switch): the `condition` out pin feeds [branch](https://docs.rual.nl/block-types/flow/branch).

![Studio canvas example for the switch block: typical wiring for switch.](https://docs.rual.nl/canvas-examples/condition_switch.png)

### Version history

Introduced in [`v12.0.4`](https://docs.rual.nl/core-versions/120004).
