# Variable Switch Action

Use this action to execute operations based on the value of an existing variable. You can, for example, change the conversation flow redirecting the user to a different interaction.

![](/files/-Lg20bEFRhE6Ug5KN3G_)

### Settings

The action uses the following settings:

| Setting       | Description                                                       | [Parsed](/actions-and-operations/dynamic-parsing.md) |
| ------------- | ----------------------------------------------------------------- | ---------------------------------------------------- |
| Variable Name | The name of the variable that will be checked by the action       | :no\_entry:                                          |
| Criteria      | The type of criteria that will be used against the control value  | :no\_entry:                                          |
| Control Value | The value that needs to be checked against the criteria           | :white\_check\_mark:                                 |
| Confidence    | The confidence percent to be applied to string equality criterias | :no\_entry:                                          |

### Remarks

The Control Value field supports multiple values checking in a single action. You can use a pipe (|) symbol to check multiple possible values. So to match *this is awesome* and *this is great*, you can enter *this is awesom&#x65;**|**&#x74;his is great* in Control Value.

Additionally, the value of the selected variable name will be automatically split by ; and checked against all the possible values. Keep that in mind when using concatenate.

![](/files/-MKjIfobvwnxrux12Hz8)

{% hint style="info" %}
Numeric criteria like Greater Than, Lesser Than or Between will always automatically attempt a conversion of the selected variable value to a number. If the variable is empty or the conversion to a number fails, the value will be assumed to be 0 (zero).\
So, as an example, if the variable *test* is empty, a conditional switch checking if value equal to 0 (zero) will return true.
{% endhint %}

### Trigger

On Condition Met. This action will trigger any child operation as the condition set by criteria and value is met.

### Variables

This action produces the following variables after being triggered:

| Variable       | Description                                                          |
| -------------- | -------------------------------------------------------------------- |
| trigger\_value | Contains the value of the composite check that triggered the clause. |

### Availability

Channel specific availability follows the table below:

| Channel          | Availability     |
| ---------------- | ---------------- |
| Facebook         | Fully Available. |
| WhatsApp         | Fully Available. |
| Telegram         | Fully Available. |
| Web              | Fully Available. |
| Alexa            | Fully Available. |
| Google Assistant | Fully Available. |
| Slack            | Fully Available. |
| API              | Fully Available. |

This action can be used only inside interactions and not as child of other actions.&#x20;

### Further Reading

{% embed url="<https://www.xenioo.com/en/creating-first-chatbot/>" %}


---

# 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.xenioo.com/actions-and-operations/flow/xenioo.bots.actions.base.variableconditionaction.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.
