---
title: "switch · RUAL Documentation"
description: "returns an array based of the given expression."
canonical: https://docs.rual.nl/block-types/array/array_switch
language: en
---

# switch

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

returns an array based of the given expression.

- expression required `value` The expression to evaluate.

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

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

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

Evaluates the expression against the configured cases and outputs the array wired to the matching case, with matched=true. When no case matches, the default pin's array is output with matched=FALSE - matched reports a non-default hit, not whether an output exists. With no match and no default, array is null and matched is false.

A typical wiring for [switch](https://docs.rual.nl/block-types/array/array_switch): the `array` out pin feeds [length](https://docs.rual.nl/block-types/array/array_length).

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

### Version history

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