# Conditions and operators

Conditions are a way that attributes can be used to shape the flow of the conversation. These conditions are essentially asking a question. If the answer to that question is yes, then the message is eligible for use in the conversation. The various questions being asked are called Operations.&#x20;

## Available operations on individual conditions

<table data-view="cards" data-full-width="true"><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td><strong>Is True</strong></td><td>Can be used with Boolean Attributes</td><td>Checks if Attribute value is equal to "True"</td></tr><tr><td><strong>Is False</strong></td><td>Can be used with Boolean Attributes</td><td>Checks if Attribute value is equal to "False"</td></tr><tr><td><strong>Equals</strong></td><td>Can be used with Integer, Float, and String Attributes</td><td>Checks if Attribute value is equal to a set value in the condition</td></tr><tr><td><strong>Not Equals</strong></td><td>Can be used with Integer, Float, and String Attributes</td><td>Checks if Attribute value is not equal to a set value in the condition</td></tr><tr><td><strong>Greater Than</strong></td><td>Can be used with any Attribute with a numerical value</td><td>Checks if Attribute value is greater than the set value in the condition</td></tr><tr><td><strong>Greater Than or Equal To</strong></td><td>Can be used with any Attribute with a numerical value. </td><td>Checks if Attribute value is greater than or equal to the set value in the condition</td></tr><tr><td><strong>Less Than</strong></td><td>Can be used with any Attribute with a numerical value</td><td>Checks if Attribute value is less than the set value in the condition</td></tr><tr><td><strong>Less Than or Equal To</strong></td><td>Can be used with any Attribute with a numerical value. </td><td>Checks if Attribute value is less than or equal to the set value in the condition</td></tr><tr><td><strong>Time Passed Equals</strong></td><td>Can be used with last_seen Attribute</td><td>Checks if last_seen Attribute is equal to the set value in the condition</td></tr><tr><td><strong>Time Passed Greater Than</strong></td><td>Can be used with last_seen Attribute</td><td>Checks if last_seen Attribute is greater than the set value in the condition</td></tr><tr><td><strong>Time Passed Less Than</strong></td><td>Can be used with last_seen Attribute</td><td>Checks if last_seen Attribute is less than the set value in the condition</td></tr><tr><td><strong>Is Not Set</strong></td><td>Can be used with any Attribute</td><td>Checks if the Attribute does not have a value set</td></tr><tr><td><strong>Is Set</strong></td><td>Can be used with any Attribute</td><td>Checks if the Attribute does have a value set</td></tr><tr><td><strong>Is Empty</strong></td><td>Can be used with any Attribute</td><td>Checks if the Attribute does not have a value</td></tr><tr><td><strong>Is Not Empty</strong></td><td>Can be used with any Attribute</td><td>Checks if the Attribute value does have a value</td></tr><tr><td><strong>In Set</strong></td><td>Can be used with String Attributes</td><td>Checks if the Attribute value includes the text value set in the condition</td></tr><tr><td><strong>Not In Set</strong></td><td>Can be used with String Attributes</td><td>Checks if the Attribute value does not include the text value set in the condition</td></tr><tr><td><strong>Is Before</strong></td><td>Can be used with Timestamp attributes</td><td>Checks if the Attribute value is before the value set in the condition. The value may be a textual representation and contain a timezone such as "10:00 BST".</td></tr><tr><td><strong>Is After</strong></td><td>Can be used with Timestamp attributes</td><td>Checks if the Attribute value is after the value set in the condition. The value may be a textual representation and contain a timezone such as "18:00 BST".</td></tr><tr><td><strong>Is Past</strong></td><td>Can be used with Timestamp attributes</td><td>Checks if the Attribute value is in the past relative to the time at the moment of evaluation.</td></tr><tr><td><strong>Is Future</strong></td><td>Can be used with Timestamp attributes</td><td>Checks if the Attribute value is in the future relative to the time at the moment of evaluation.</td></tr><tr><td><strong>Is Today</strong></td><td>Can be used with Timestamp attributes</td><td>Checks if the Attribute value is today at the moment of evaluation.-</td></tr></tbody></table>

## Operators to combine multiple conditions

You can chain or group multiple conditions (two or more) together and apply them to any Conversation Object or Message Template, enabling validation through an operator. Currently, the supported operators for chaining conditions are **And** and **Or**.

By default, the operator for multiple conditions is set to **And**.

#### **Example**

Let’s consider an example with two conditions for a Conversation Object: `user_name` and `user_email`.

* **And Operator**: If the operator is set to **And**, the chained conditions will be true only when *both* conditions are met. For instance, the object will be considered valid only if both `user_name` and `user_email` are set.

<figure><img src="https://3203401256-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdP6xFXXyeBbibro1Ywnq%2Fuploads%2F4YJuzveHr189vYoIlhQt%2Fimage.png?alt=media&#x26;token=ddb0ec45-f14c-4e94-943f-0fcbd25ba094" alt=""><figcaption><p>Conditions And operator</p></figcaption></figure>

* **Or Operator**: When the operator is set to **Or**, the chained condition will be true if *either* of the conditions is met. In this case, the object will be valid if either `user_name` or `user_email` is set.

<figure><img src="https://3203401256-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdP6xFXXyeBbibro1Ywnq%2Fuploads%2F9PFfLWPEftRI9UkaaOpt%2Fimage.png?alt=media&#x26;token=8543d04c-e2f4-4425-9226-05c0e475b9d4" alt=""><figcaption><p>Conditions Or operator</p></figcaption></figure>

The above also applies to Message Templates.<br>

<figure><img src="https://3203401256-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdP6xFXXyeBbibro1Ywnq%2Fuploads%2FBzeOD63Qs4J0Yh4b6xbT%2Fimage.png?alt=media&#x26;token=f87030df-eff4-4f4d-9ad7-6fbfeccf564e" alt=""><figcaption><p>Message Template conditions OR operator</p></figcaption></figure>

{% hint style="info" %}
When adding more than two conditions, you will be asked to select an operator.  This operator will apply to all set conditions.  So, if you create 3 conditions, the AND  or OR operator will apply to all 3.
{% endhint %}
