# Conditions

This section describes the use of conditions within flows. A condition is used to make certain behaviours conditional, like:

1. skipping a node
2. guarding a trigger
3. branching

## What are conditions?

Conditions consist of one or more rules that check whether something is true or false. Each rule (also referred to as an expression) compares values in a specific way. For example, it may check whether a phone number exists, or if a number is greater than 10.

When you have multiple rules, the condition combines them to give a final result: either the condition is `true` (all rules pass) or `false` (at least one rule fails). This result determines what happens next in your Flow.

For example, if you use a condition in the **Skip when** option of a node, the node will be skipped if the condition evaluates to true.

## Where are conditions used?

### Skipping a node

If you want certain Flow nodes to be skipped in certain circumstances, you can use conditions as "skip logic". Every node in your Flow has the option to be skipped based on a condition. This feature is available in the **Advanced** section of the properties panel of your Flow node.

<figure><img src="https://3356808761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEBQHGJABNTj5ISSOTRxM%2Fuploads%2Ffdea7ctOyApWCAHU6xCA%2Fimage.png?alt=media&#x26;token=26ffc885-c047-4e40-9051-856e2bc8633b" alt=""><figcaption><p>Add condition as skip logic</p></figcaption></figure>

### Guarding a trigger

[Triggers](https://manuals.dialox.ai/studio/flows/triggers) to your Flows can be guarded by conditions so you can have different entry points for different scenarios. This enables you to have a different Flow based on user or conversation variables.

<figure><img src="https://3356808761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEBQHGJABNTj5ISSOTRxM%2Fuploads%2F185nuHwDhxsbYWgIPtEe%2Fimage.png?alt=media&#x26;token=b15347b8-2a7f-49f7-952a-620c9714397f" alt=""><figcaption><p>Add condition as trigger guard <strong>When</strong></p></figcaption></figure>

### Branching

Another way to make your Flow behave conditionally is by adding a [**Branch**](https://manuals.dialox.ai/studio/flows/nodes/control-flow-branch) node to your Flow. The branches will be evaluated from left to right, and the first branch condition that evaluates to `true` will be executed.

<figure><img src="https://3356808761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEBQHGJABNTj5ISSOTRxM%2Fuploads%2FWK7spywHiBZFVjVWuGMa%2Fimage.png?alt=media&#x26;token=18ac49e3-65ba-4a99-aa5a-97b7b8b64720" alt=""><figcaption><p>Add condition to a branch</p></figcaption></figure>

## How to build a condition

By clicking on the **Add condition** button, a popup appears in which the condition can be specified. As explained, a condition consists of one or more rules (expressions).

### Rule types

A rule can be based on:

* tags
* channels
* any of the [variables](https://manuals.dialox.ai/studio/flows/variables)

<figure><img src="https://3356808761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEBQHGJABNTj5ISSOTRxM%2Fuploads%2Foy3yXl1bP7caTmERQCBe%2Fimage.png?alt=media&#x26;token=4f118dee-64e9-41c8-b333-0dd9e150acdd" alt=""><figcaption><p>Expression type selection</p></figcaption></figure>

#### Rules based on tags

The easiest and most commonly used way to create a rule is by checking the existence of certain [tags](https://manuals.dialox.ai/studio/flows/tags) in your conversation. Therefore, the condition type is set to **Tags** by default:

<figure><img src="https://3356808761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEBQHGJABNTj5ISSOTRxM%2Fuploads%2FqpV9U5xyFK0577kx72YJ%2Fimage.png?alt=media&#x26;token=351485f3-dc48-4708-984d-7b63d938e32b" alt=""><figcaption><p>Creating your condition</p></figcaption></figure>

The way the tags are evaluated depends on which expression type is used to compare the selected tags:

| Tag comparison type | Evaluates to true when…               |
| ------------------- | ------------------------------------- |
| Any of              | One or more of the given tags are set |
| All of              | All given tags are set                |
| None of             | None of the provided tags are set     |

<figure><img src="https://3356808761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEBQHGJABNTj5ISSOTRxM%2Fuploads%2FE8M8edt3Dx0ugq18pdD3%2Fimage.png?alt=media&#x26;token=886b5c02-89f2-4e5c-b241-26da4cb5893e" alt=""><figcaption><p>Example condition based on tags</p></figcaption></figure>

The above screenshot shows an example where either the user's phone number or their email address needs to be set for the condition to evaluate to true. This works because the platform will automatically set a user tag when the user's phone number or email address is known, see [User tags](https://manuals.dialox.ai/settings/app-settings/tags#user-tags).

In the above example, the condition evaluates to true if at least one of the tags is present. If the use case requires both to be present, you should set the expression type to **All of**. If, on the other hand, you want to check if none of these fields are present, you should select **None of**.

#### Rules based on channels

If multiple channels are available to your Smart App, you might want to execute certain logic based on the channel the conversation is running in. This can easily be done using the rule type **Channel**.

<figure><img src="https://3356808761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEBQHGJABNTj5ISSOTRxM%2Fuploads%2FjmaAD7x1WooEzuNwDAh3%2Fimage.png?alt=media&#x26;token=bbba08fb-6875-4389-a1b3-f61ab1c3ca4c" alt=""><figcaption><p>Example condition based on channel</p></figcaption></figure>

In this example, the condition will only evaluate as `true` on phone channels, which prevents this logic from being executed on any of the other channels.

#### Rules based on variables

A very precise and customizable way to use rules is by using [variable](https://manuals.dialox.ai/studio/flows/variables) comparison. By using logical operators (see next paragraph) the user and/or conversation variables can be compared to certain values in order for to evaluate the condition to `true` or `false`. For example, to check whether a caller's phone number starts with a certain area code, or whether the user's name is equal to a certain name.

<figure><img src="https://3356808761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEBQHGJABNTj5ISSOTRxM%2Fuploads%2FVNX4ZNEsKCMWV7PBP2vE%2Fimage.png?alt=media&#x26;token=3abeb88d-0b40-4757-9dc3-62db8df5f0b9" alt=""><figcaption><p>Example condition based on a variable</p></figcaption></figure>

### Operators

An operator is a way to compare or check values. It defines how two things are compared. Think of it like asking different types of questions: "Does the `company_name` contain `"Enreach"`?", "Is the `age` equal to or higher than `65`?", etc.

Variables and values can have different types, which has an effect on which operators can be used on them.

#### Text operators

Text operators can only be used on text type variables, which are also called strings. A variable of type string holds textual values, like "ABC", "John Doe", "I would like to order 3 pizzas", or even "1234". (Note that while a string can contain numbers, those numbers are treated as text and cannot be used in calculations or number comparisons.)

As you saw in the above examples, the operator `==` can be used in a rule to evaluate if a variable is exactly the same as a given value. There are also other expression operators that can be used for Text . For instance, to check if a variable does not equal, i.e. is different from, a certain value.

<figure><img src="https://3356808761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEBQHGJABNTj5ISSOTRxM%2Fuploads%2FQplvFUt6Evrz3SFsW4NN%2Fimage.png?alt=media&#x26;token=5175c665-4915-4fef-85f4-de4bf1f1f2a5" alt=""><figcaption><p>Expression operators</p></figcaption></figure>

The following table describes the different operators in more detail.

<table><thead><tr><th width="170">Operator</th><th>Description</th><th>Example for true</th></tr></thead><tbody><tr><td>==</td><td>to check A and B are the same</td><td>"info@enreach.com" == info@enreach.com</td></tr><tr><td>!=</td><td>to check A and B are not the same</td><td>"info@enreach.com" != info@dialox.com</td></tr><tr><td>Contains</td><td>to check if B is a part of A</td><td>"info@enreach.com" contains "enreach"</td></tr><tr><td>Not contains</td><td>to check if B is not part of A</td><td>"info@dialox.ai" not contains "enreach"</td></tr><tr><td>Starts with</td><td>to check if A starts with B</td><td>"info@enreach.com" starts with "info"</td></tr><tr><td>Ends with</td><td>to check if A ends with B</td><td>"info@enreach.com" ends with "com"</td></tr><tr><td>Is empty</td><td>to check if A has no value, often used to check if a question was not asked yet.</td><td>Email Is Empty</td></tr><tr><td>Is not empty</td><td>to check if A has a value, often used to check if a question is already asked</td><td>Email Is not empty</td></tr></tbody></table>

#### Number operators

Variables of type `number` can only hold numeric values, like 1234. When working with numbers, you need to be able to compare them to smaller or larger numbers. Unlike with [string values](#string-operators), checking if they contain or start with a certain digit is not relevant. If you want to use numeric operators, make sure your variables are stored as numbers (see [Variables](https://manuals.dialox.ai/studio/variables#creating-custom-variables)).

The following table describes the operators for numbers:

<table><thead><tr><th width="170">Operator</th><th>Description</th><th>Example for true</th></tr></thead><tbody><tr><td>==</td><td>to check A and B are the same</td><td>"info@enreach.com" == info@enreach.com</td></tr><tr><td>!=</td><td>to check A and B are not the same</td><td>"info@enreach.com" != info@dialox.com</td></tr><tr><td>&#x3C;</td><td>to check A &#x3C; B</td><td>5 &#x3C; 10</td></tr><tr><td>&#x3C;=</td><td>to check A &#x3C;= B</td><td>5 &#x3C;= 5</td></tr><tr><td>></td><td>to check B > A</td><td>10 > 5</td></tr><tr><td>>=</td><td>to check B ≥ 5</td><td>5 ≥ 5</td></tr><tr><td>Is null</td><td>to check A is empty</td><td></td></tr><tr><td>Is not null</td><td>to check A is not empty</td><td>5</td></tr></tbody></table>

#### Date and datetime operators

Variables of type date and datetime can only hold respectively date and datetime values, like 2025-07-21. Date and datetime conditions can have the same type of operators as [number variables](#number-operators). In this case, `greater than` (`>`) checks if a date is numerically larger, which translates to `later than` ('after') in 'human' language.

#### Boolean operators

Variables of type boolean can hold either `true` or `false`, so comparisons can be done on the basis of the variable having a true or false value.

### Add another rule

As explained at the beginning of this chapter, conditions consist of one or more rules. So when you have configured your first rule, feel free to try adding another rule by hovering your mouse over the rule. You will see two buttons appear: **Add rule** and **Add group**. In this paragraph we will focus on adding a new rule.

<figure><img src="https://3356808761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEBQHGJABNTj5ISSOTRxM%2Fuploads%2Fl3CWVZ24ARs4H0OtVAz3%2Fimage.png?alt=media&#x26;token=fa0a9c60-7f1b-405a-888e-bd802fca61ff" alt=""><figcaption><p>Add rule</p></figcaption></figure>

The new rule can be built in the same way, but now we also need to indicate if this rule adds to the previous rule (**And**) or whether the new rule applies separately (**Or**), in which case just one of the two rules needs to evaluate to true instead of both.

<figure><img src="https://3356808761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEBQHGJABNTj5ISSOTRxM%2Fuploads%2FIu686cg6h2bGVLLR1nh2%2Fimage.png?alt=media&#x26;token=57165236-8ab8-456a-ae70-ef563691b98a" alt=""><figcaption><p>And / Or</p></figcaption></figure>

### Add a group

When building complex conditions, you might want to use groups. A group of rules is evaluated as one. Just as with mathematical evaluations, groups work like parentheses. In this example: (1+1) x (2+2) evaluates to 2 x 4 = 8. When not using parentheses, the equation would lead to something completely different: 1 + 1 x 2 + 2 = 5.

A group can be added by hovering the mouse over one of the rules and clicking on the **Add group** button:

<figure><img src="https://3356808761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEBQHGJABNTj5ISSOTRxM%2Fuploads%2FirGJIprLhqUawJkwE5Qx%2Fimage.png?alt=media&#x26;token=e69f0d30-6744-429a-bcbb-e566aac80408" alt=""><figcaption><p>Add group</p></figcaption></figure>

For conditions it works the same way, so consider the following example:

<figure><img src="https://3356808761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEBQHGJABNTj5ISSOTRxM%2Fuploads%2FMazRznZV9u6VlcaeqUYK%2Fimage.png?alt=media&#x26;token=9d3694ed-6cfb-4c5c-9c64-a57c7b05907b" alt=""><figcaption><p>Defining complex group expressions</p></figcaption></figure>

In this example, the condition evaluates to true when either the system is online and the first name of the user is Niels, OR when the system is offline while the first name is not yet set.
