> For the complete documentation index, see [llms.txt](https://docs.incari.com/incari-studio/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.incari.com/incari-studio/2023.1/toolbox/flow-control/switch.md).

# Switch

## Overview

![The Switch Node.](/files/VKRZvxFf3Y0Hih4ch6Fw)

**Switch** takes an input value and triggers one of several output **Pulses**, based on whether or not the input matches a pre-defined value. These pre-defined values, referred to as *cases* in computer programming, can be defined as a list in the `Cases` **Attribute**. Each value added to the **Node** also creates a corresponding output **Pulse**. If the value of the `Input` **Socket** matches a value defined in the `Cases` **Attribute**, its corresponding **Pulse** is triggered. If no match is found, then the `Default` **Pulse** is triggered instead.

[**Scope**](/incari-studio/2023.1/toolbox/overview.md#scopes): **Project**, **Scene**, **Function**, **Prefab**.

## Attributes

![The Switch Node Attributes.](/files/hsf0cxlHCFBDTZypvIyW)

### Inputs

| Attribute   | Type          | Description                                                        |
| ----------- | ------------- | ------------------------------------------------------------------ |
| `Data Type` | **Drop-down** | The type of data that will be plugged into the `Input` **Socket**. |

### Outputs

| Attribute   | Type                                          | Description                                                                            |
| ----------- | --------------------------------------------- | -------------------------------------------------------------------------------------- |
| `Cases [n]` | *Defined in the `Data Type`* ***Attribute**.* | The pre-defined values, which will be compared to the value of the `Input` **Socket**. |

## Inputs

| Input             | Type                                          | Description                                                           |
| ----------------- | --------------------------------------------- | --------------------------------------------------------------------- |
| *Pulse Input* (►) | **Pulse**                                     | A standard input **Pulse**, to trigger the execution of the **Node**. |
| `Input`           | *Defined in the `Data Type`* ***Attribute**.* | The value to be compared with the list of pre-defined `Cases`.        |

## Outputs

| Output      | Type      | Description                                                                                                                                      |
| ----------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Case: [n]` | **Pulse** | An **Output Pulse** for each pre-defined *case*, whose execution is triggered if the corresponding value is evaluated as being equal to `Input`. |

## External Links

* [*Switch statement*](https://en.wikipedia.org/wiki/Switch_statement) on Wikipedia.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.incari.com/incari-studio/2023.1/toolbox/flow-control/switch.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
