# Switch Case

**Switch Case** node lets you check for a condition based on a **variable** which might be the result of some other conditions as well. Depending on the value of the **variable**, the Flow Execution will be sent to the branch matching that particular value.

### Adding Switch Case node at the end

As you see in the below image, a **Switch Case** node comes with two default child branches - **Default Case** and **Add Case** branch. You can keep adding cases in the switch as well as use the Default Branch for **Default** case.

<figure><img src="https://392607133-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZCdm9aJ8vkvDIIbg04AL%2Fuploads%2F9uFzfPGB07Q9b9fy0mN1%2FScreenshot%202024-03-13%20at%202.04.11%E2%80%AFPM.png?alt=media&#x26;token=bb711162-2a28-44af-96f1-0aa9c602271e" alt="" width="375"><figcaption></figcaption></figure>

### Adding Switch Case node between 2 nodes

If you try adding the **Switch Case** node between 2 existing nodes, you will see a popup asking you which branch should the existing children be part of.

<figure><img src="https://392607133-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZCdm9aJ8vkvDIIbg04AL%2Fuploads%2F73CWUyCSWp5qO8bQzeW2%2FScreenshot%202024-03-13%20at%202.03.56%E2%80%AFPM.png?alt=media&#x26;token=dca7bf0a-d2fa-4991-9cb3-c233483c2609" alt="" width="375"><figcaption></figcaption></figure>

This is because **Switch Case** node breaks the flow into 2 or more separate branches, **which never merge**.

{% hint style="warning" %}

### Deleting Switch Case node

If you plan to delete the **Switch Case** node, keep in mind that it will **delete the whole flow** **below** the current Switch Case node as the system does not know which branch to connect to the parent node.
{% endhint %}

### Properties Panel

<table><thead><tr><th>Field</th><th width="511">Description</th><th>Required</th></tr></thead><tbody><tr><td>Node name</td><td><a href="../../node-name"><mark style="color:blue;"><strong>Checkout Node name</strong></mark></a></td><td>true</td></tr><tr><td>Switch Value</td><td>The value which needs to be checked in the Switch condition.<br><br>This can also be a Magical Autocomplete.</td><td>true</td></tr><tr><td>Switch Value Type</td><td>The datatype of the Switch values to be typecasted into.</td><td>true</td></tr><tr><td>Cases</td><td>A list of cases to be checked, else default case.<br><br>Each case creates a new branch in the Flow Builder.</td><td>true</td></tr></tbody></table>

### Returns

`condition` - The boolean result of the condition at runtime. You can access this using Magical Autocomplete (Eg. `$.<node_name>.condition`) in any node below this node.
