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

# switch

This block is part of the [`value`](https://docs.rual.nl/block-types/value) group and was last modified in core [`v10.4.28`](https://docs.rual.nl/core-versions/100428).

Returns a value based of the given expression.

- expression required `value` The expression to evaluate.

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

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

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

String-compares the expression's value, EXACT and case-SENSITIVE, against each case pin's NAME and outputs the value wired into the matching case pin; when nothing matches it outputs the default pin's value. matched is true only for a non-default match; with no match and no default wired, value is nil and matched is false. There is no fall-through and no partial matching.

A typical wiring for [switch](https://docs.rual.nl/block-types/value/value_switch): the `value` out pin feeds [convert to uppercase](https://docs.rual.nl/block-types/value/value_to_uppercase).

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

### Version history

Introduced in [`v10.4.28`](https://docs.rual.nl/core-versions/100428).
