# Switch

![](https://476758574-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVctm8W2AAd8SbIYUaj27%2Fuploads%2FCtXpCVSNeaeJAFI55yNW%2Fimage.png?alt=media\&token=496c1ebe-3fc6-4765-9ae2-67f9003feb1b)

{% tabs %}
{% tab title="Entry Vars" %}
**Cases :** It is a dynamic entry var, that is, you can add as many as needed by the user to compare the value of a variable or expression.

The field to be compared is added by name and then the + icon is clicked to add the case.

**Value :** It is the value to evaluate, it can come from a variable, control or function

**Step by Step :**

<figure><img src="https://476758574-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVctm8W2AAd8SbIYUaj27%2Fuploads%2F3GqK2GuWmxwEuZ3b9i0t%2FSwitch.gif?alt=media&#x26;token=3a25412d-ce61-41c5-b9c6-1ebe797009cd" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Callbacks & Outvar" %}
**Default :** It is executed when none of the values ​​declared in cases match.

**Cases:** For each Case that is opened from the entry vars, a callback will be created, with the same name of each case. Each one of them will be activated when the evaluated value is equal to the case. Returning the evaluated value.

OutVars&#x20;

```json
{
    "return": {
        "timestamp": 1662146155637,
        "args": "verde"
    }
}
```

{% endtab %}

{% tab title="Features" %}

* Cuando el valor evaluado no coincide con ninguno de los casos (cases) entonces se activa el callback Default. Este callback, no retorna nada.
* Se podría comparar el switch como un conjunto de funciones condicional usando el operador ==
  {% endtab %}

{% tab title="examples" %}

<figure><img src="https://476758574-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVctm8W2AAd8SbIYUaj27%2Fuploads%2FThWhY6nibZp8qMph7DYV%2FWhatsApp%20Image%202022-09-02%20at%2015.59.07.jpeg?alt=media&#x26;token=058d527c-baee-4d11-a2f3-8841adfb25a2" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}
