---
title: "switch · RUAL Documentation"
description: "Returns an attribute based on the given expression."
canonical: https://docs.rual.nl/block-types/attributes/uiattributes_switch
language: en
---

# switch

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

Returns an attribute based on the given expression.

- expression required `value` The expression to evaluate.

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

- output `uiattributes` Returns the attributes matching the expression.

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

A typical wiring for [switch](https://docs.rual.nl/block-types/attributes/uiattributes_switch): the `uiattributes` out pin feeds [regular card](https://docs.rual.nl/block-types/state%20ui/state_card).

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

### Version history

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