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.
Understand how conditional logic works
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
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
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.
There are three ways to populate variables:
Ask chatters to enter data using Capture blocks
Automatically load data from APIs using HTTP Request blocks
Automatically pass data from your website to your bot using metavariables
After you have created your variables, you can use the Conditional block to set up your personalized chatter journeys.
Insert the Conditional block
On the Ada dashboard, go to Build > Answers.
Select or create the Answer you want to put the quick replies into. Then, drag and drop the Conditional block into the Answer editor.
Create a condition. On the dashboard, your first condition is indicated with the
symbol.
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 the 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"; thecountry
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"; theaccount_type
variable's value is equal to "gold").
Choose a variable to use as a basis of comparison. There's no limit to the number of variables you can use.
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 section of this topic.
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
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 acceptword
,WORD
, orwOrd
as matches.
To add additional criteria, click the Add button
and repeat steps b-d.
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 both of these blocks are designed to contain other blocks instead. If you need more complex logic in your bot, contact your Ada team for assistance.
To add additional conditions, click the Add Condition button
and repeat steps 3-4. Additional conditions are indicated with the
symbol.
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
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 are logic statements that tell the Conditional block to match chatter information that’s captured in the variable you’re using. The available operators vary based on the variable type you're using:
Operator | Variable types | Description |
---|---|---|
|
| Match information in the variable that begins with certain text (partial match). |
|
| Match information in the variable that ends with certain text (partial match). |
|
| Match information in the variable that contains certain text in any position (partial match). |
|
| Match information in the variable that equals specific text exactly (exact match). |
|
| Match information in the variable that does not equal specific text exactly (exact match). |
|
| Match if there is no information contained in the variable. |
|
| Match if there is any information contained in the variable. |
|
| Match if the information in the variable is greater than a specific value. |
|
| Match if the information in the variable is less than a specific value. |
|
| Match if the information in a variable is Yes (or True). |
|
| Match if the information in a variable is No (or False). |
|
| Match if none of the selected items contains this value. |
|
| Match if the chatter selected a particular number of options in a List Option block. |
|
| Match if the chatter selected more than a particular number of options in a List Option block. |
|
| Match if the chatter selected fewer than a particular number of options in a List Option block. |
Chatter view
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:
![]() |
Have any questions? Contact your Ada team—or email us at help@ada.support.