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

# switch

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

### Connection Type

This block connects from a `query` type block. Make sure to connect this block to the appropriate left-hand side connection.

Returns a query based of the given expression.

- expression required `value` The expression to evaluate.

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

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

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

A typical wiring for [switch](https://docs.rual.nl/block-types/query/query_switch): the `query` out pin feeds [cast to object](https://docs.rual.nl/block-types/query/query_convert_to_object).

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

### Version history

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