# Switch

## Description:

Switch

The switch expression is evaluated once. The value of the expression is compared with the values of each case. If there is a match, the associated block of code is executed.

### Allowed Parent Components:

1. Aggregate Card
2. Card Body
3. Card Table Column
4. Col
5. DataList
6. Form
7. Horizontal Section
8. Popup
9. Scroll Layout
10. Side Tab Item
11. Tab Item
12. Vertical Section

### Allowed Child Components:

1. Case
2. Trigger Before Render

### Properties

### ➤ View Attribute

Choose an attribute for the switch condition. Leave this blank to specify an expression instead. This value will be matched with each of the case and the first matching case's children will be chosen to render.

Allowed Values: Choose an attribute for the switch condition. Leave this blank to specify an expression instead. This value will be matched with each of the case and the first matching case's children will be chosen to render.

### ➤ Expression

Provide an expression that must return a string value to be used for the switch condition. This expression's outcome will be matched with each of the case and the first matching case's children will be chosen to render.

Allowed Values: An expression which should return string after evaluation


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cloudio.io/ui-components/widgets/switch.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
