> This page is for version Scripted.
> For other versions, use one of these documentation indexes:
> - Generative (default): https://developers.ada.cx/generative/llms.txt
> - Scripted: https://developers.ada.cx/scripted/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.ada.cx/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.ada.cx/_mcp/server.

# Target content to chatters using the Conditional block

## Overview

With the Conditional block, you can deliver different content to
different chatters, making your bot's conversations more personal and
effective. To differentiate chatters, you can set up logic statements
based on variable values.

**Examples:**

* Offering chatters a discount on a product they don't own yet.

* Recognizing a mobile device type, and serving iOS- or Android-specific
  content.

* Identifying chatters by account type, and providing different support
  options accordingly.

> **Note**
>
> This feature may not be included with your organization's subscription
> package. For more information, see Ada's
> [Pricing](https://www.ada.cx/pricing) page, or contact your Ada team.

### Understand how conditional logic works\[#UUID-a1bf4699-89db-3d49-a115-504cd55c17f6_section-idm454971437126083342438843222]

The Conditional block uses logic to decide whether it should serve
content to chatters. Sometimes this is called "if-then-else" logic.
Here's how it works in Ada:

* **If** statement: Set up the criteria your bot uses to decide whether
  to serve the chatter with a piece of content.
  * Within a single If statement, you can have multiple criteria. You
    can choose to make all of these criteria necessary ("if x AND y") or
    just one of them ("if x OR y").
* **Then** action: Set up the action your bot takes if the user meets
  the criteria.
  * For each If statement you create, drag in content blocks to serve to chatters who meet that condition. If a chatter doesn't meet the
    criteria, the bot moves on to the next condition and try again,
    until it reaches the Else condition.
* **Else** action: Set up the action your bot takes if none of the above if statements apply. If you don't set up an Else action, the bot effectively doesn't have any instructions, and doesn't perform any of the actions in your Conditional block.

### Watch a demo\[#UUID-a1bf4699-89db-3d49-a115-504cd55c17f6_section-idm4552990674075233424650216182]

Ready to begin? Read on, or watch this demo to see an example of the
Conditional block at work:

## Use the Conditional block in an Answer\[#UUID-a1bf4699-89db-3d49-a115-504cd55c17f6_id_360018565153_id_h_2ff34548-86f2-4f9e-bb68-2311e1fa6b0e]

In the Conditional block, you can set up different behaviors depending
on the value of a variable. If you need a refresher on how to capture
and store chatter information in variables, see [Get started with variables](/scripted/docs/build-and-maintain-your-bot/personalize-conversations/get-started-with-variables).

There are three ways to populate variables:

* Ask chatters to enter data using [Capture blocks](/scripted/docs/build-and-maintain-your-bot/work-with-blocks-and-apps/save-chatter-information-using-the-capture-block)

* Automatically load data from APIs using [HTTP Request blocks](/scripted/docs/build-and-maintain-your-bot/work-with-blocks-and-apps/make-api-requests-using-the-http-request-block)

* Automatically pass data from your website to your bot using
  [metavariables](/scripted/docs/build-and-maintain-your-bot/personalize-conversations/get-started-with-variables)

After you have created your variables, you can use the Conditional block
to set up your personalized chatter journeys.

### Insert the Conditional block\[#UUID-a1bf4699-89db-3d49-a115-504cd55c17f6_id_360018565153_id_h_39ba7f89-78ff-4453-8a37-7aed02a7f359]

1. On the Ada dashboard, go to **Build** > **Answers**.

2. Select or create the Answer you want to put the conditional content into. Then, drag and drop the Conditional block into the Answer editor.

3. Create a condition. On the dashboard, your first condition is
   indicated with the ![](/_fern-files/_img/03c32bd2872da7b64b6d3a29a4af8fc3859ce62aea366543c245ff39a3df4be3.webp) symbol.

   1. If you want your condition to work with multiple criteria, you
      can choose how that behavior works. Select either **If all
      of** or **If any of** in the dropdown list. With
      this option, you can create multiple criteria for the same condition,
      and define the logic that determines whether your bot serves the content
      for this condition or if it moves on to the next condition.
   **Example**:
   * You want to send a message to chatters who have both
     gold level accounts and who live in Canada. In this case, you select **If all of**, and you create two criteria (the `account_type` variable’s value is equal to “gold”; the `country` variable’s value is equal to  “Canada”).
   * You want to send a message to chatters who have either silver or gold level accounts. in this case, you select **If any of**, and you create two criteria (the `account_type` variable’s value is equal to “silver”; the `account_type` variable’s value is equal to “gold”).
   4. Choose a variable to use as a basis of comparison. There’s no
      limit to the number of variables you can use.
   5. Choose an operator. The comparison operators available vary
      depending on the type of variable you chose in step b; for more
      information, see the [Understand comparison operators](#comparison-operators) section of this topic.
   6. If the operator you chose compares the variable to a value,
      configure that value. To the right of the **Value** field,
      click the **Options** button ![](/_fern-files/_img/d0066485566bfdcf05498372e70c0cc1fb3d3a95f2091f36786ad737fbe72176.webp) and choose your field options. Then, enter a value to check against the
      variable’s value.
   * **Basic**: Compare the variable with a value you
     type yourself.

   * **Variable**: Compare the variable with a different
     variable.

   * **Match Case**: Only allow matches if the case
     matches for both the variable and your comparison value. For example, if
     the value you enter is `Word`, your bot wouldn't accept `word` , `WORD`, or `wOrd` as
     matches.
   8. To add additional criteria, click the **Add** button ![](/_fern-files/_img/870c03074294e150ef7a4a24aac3d6015af4a9ef6897ae0a5983407873484ce5.webp) and repeat steps b-d.

4. Under the condition you just made, drag and drop blocks that you
   want those chatters to see.

> **Note**
>
> You can’t drag and drop Conditional or Scheduled blocks into a
> Conditional block, because they're designed to contain
> other blocks instead of being contained. If you need more complex logic in your bot,
> contact your Ada team for assistance.

5. To add additional conditions, click the **Add
   Condition** button ![](/_fern-files/_img/f76acb19eb16f091ff579fce9ce757df38b6e535237f163c5626c8ca5774fd2d.webp) and repeat steps 3-4. Additional conditions are indicated with the ![](/_fern-files/_img/29f8b1d5ccf11b419087765f4a9089aa755025c41bc590d4f7bfbb4b2bc3f2b7.webp) symbol.

6. Lastly, it’s a good idea to set up an else condition, so chatters who don’t meet any of your conditions still see
   content. The action is indicated with the ![](/_fern-files/_img/fb86b6858b1b6a5df5ca5bcbb354e6a39acfbc96be5c1b082ad9490b0c14d1cd.webp) symbol. For this condition, all you have to do is drag content blocks
   in. You don’t have to set up this condition, but it’s useful as a best
   practice.

### Understand comparison operators\[#comparison-operators]

Comparison operators are logic statements that tell the Conditional
block to match chatter information that’s [captured in the variable](/scripted/docs/build-and-maintain-your-bot/personalize-conversations/get-started-with-variables)
you’re using. The available operators vary based on the variable type
you're using:

| **Operator**                                                                                                                                                                | **Variable types**                                                                   | **Description**                                                                                 |
| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------- |
| ![Begins With icon](/_fern-files/_img/e8b9c807586a4238654793da51b49ec15e7045c0691d461567178070e57a1840.webp) **Begins With**           | - All text variables (including phone and email)                                     | Match information in the variable that begins with certain text (partial match).                |
| ![Ends With icon](/_fern-files/_img/9bc404d3db5ea684a901bf8426485894bb62abb8369e498b98dc4e4f3807a5ec.webp) **Ends With**               | - All text variables (including phone and email)                                     | Match information in the variable that ends with certain text (partial match).                  |
| ![Contains icon](/_fern-files/_img/a4f0225811b1ecde2f125de907c2ad1b084268805cd89a00f465649ddbf8eaa2.webp) **Contains**                 | - All text variables (including phone and email)- List variables                     | Match information in the variable that contains certain text in any position (partial match).   |
| ![Is icon](/_fern-files/_img/7266dedcf2da1af5c496469379bd4fb68d5e65492c190e9567c75edbbbf7e260.webp) **Is**                             | - All text variables (including phone and email) - Number variables                  | Match information in the variable that equals specific text exactly (exact match).              |
| ![Is Not icon](/_fern-files/_img/d94952ab65e9f266413c582390a1d702ebb32c7a2023709ee96741b6df1b17e4.webp) **Is Not**                     | - All text variables (including phone and email) - Number variables                  | Match information in the variable that does not equal specific text exactly (exact match).      |
| ![Is Not Set icon](/_fern-files/_img/283cad3d89c7d92f279d722592cd958630a40527266a47d316ab3b3b2051b71f.webp) **Is Not Set**             | - All text variables (including phone and email) - Number variables - List variables | Match if there is no information contained in the variable.                                     |
| ![Is Set icon](/_fern-files/_img/8c1019797a0482018682d52622c9e2fe56ddc5aef8925dc3e3db678c121c6869.webp) **Is Set**                     | - All text variables (including phone and email) - Number variables - List variables | Match if there is any information contained in the variable.                                    |
| ![Greater Than icon](/_fern-files/_img/45636711dfe933087353da3923c6865b6816ea671ad6e9db4739aeea4c80a697.webp) **Greater Than**         | - Number variables                                                                   | Match if the information in the variable is greater than a specific value.                      |
| ![Less Than icon](/_fern-files/_img/f2448b33a8931270e63ea8daab74e67ade1fdfdf1f8853529c2fb0a3e5abda55.webp) **Less Than**               | - Number variables - List variables                                                  | Match if the information in the variable is less than a specific value.                         |
| ![Is True icon](/_fern-files/_img/fcf3fe21099df957ee22609d5a5c211601d3e402fcc8402c12115f4680a692b0.webp) **Is True**                   | - Yes/No variables                                                                   | Match if the information in a variable is Yes (or True).                                        |
| ![Is False icon](/_fern-files/_img/2b5c661e7e4445f1ea8f7736ee5b58b14f72283faf2dbd4f01220a26d621b238.webp) **Is False**                 | - Yes/No variables                                                                   | Match if the information in a variable is No (or False).                                        |
| ![Does Not Contain icon](/_fern-files/_img/2a459cf7a992abeb5cbdf8438f9f1be356bb5fcf915f55f7f1c2cdc3173b101d.webp) **Does Not Contain** | - List variables                                                                     | Match if none of the selected items contains this value.                                        |
| ![Is Equal To icon](/_fern-files/_img/7266dedcf2da1af5c496469379bd4fb68d5e65492c190e9567c75edbbbf7e260.webp) **Is Equal To**           | - List variables                                                                     | Match if the chatter selected a particular number of options in a List Option block.            |
| ![Is Greater Than icon](/_fern-files/_img/45636711dfe933087353da3923c6865b6816ea671ad6e9db4739aeea4c80a697.webp) **Is Greater Than**   | - List variables                                                                     | Match if the chatter selected more than a particular number of options in a List Option block.  |
| ![Is Less Than icon](/_fern-files/_img/f2448b33a8931270e63ea8daab74e67ade1fdfdf1f8853529c2fb0a3e5abda55.webp) **Is Less Than**         | - List variables                                                                     | Match if the chatter selected fewer than a particular number of options in a List Option block. |

### Chatter view\[#UUID-a1bf4699-89db-3d49-a115-504cd55c17f6_id_360018565153_id_h_345b78e5-8c0a-4334-b6ce-080baea76900]

After you've created a Conditional block, test it out! Pretend you’re
different kinds of chatters with different profiles and make sure your
conditional logic is working correctly.

**Example:**

![](/_fern-files/_img/79d32075fcdb9a8b4e756927e544e90bff94ab7a7f8add73f88ac9b3646c98cd.webp)

---

Have any questions? Contact your Ada team, or email us at [](<mailto:help@ada.support%20%E2%80%9CHelp Docs inquiry%E2%80%9D>).