# 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.

![](https://content.gitbook.com/content/tZEstFBYh3uMutlup6ku/blobs/Zo69PtHRmSpEEqf4n52j/image.png)

### Settings

The action uses the following settings:

| Setting       | Description                                                       | [Parsed](https://docs.mylinkconnect.com/actions-and-operations/dynamic-parsing) |
| ------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| 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.

![](https://content.gitbook.com/content/tZEstFBYh3uMutlup6ku/blobs/d6NqqmPEQuQeZFzWI0Z3/image.png)

{% 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/>" %}
