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.
This feature may not be included with your organization’s subscription package. For more information, see Ada’s Pricing page, or contact your Ada team.
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.
Then action: Set up the action your bot takes if the user meets the criteria.
Ready to begin? Read on, or watch this demo to see an example of the Conditional block at work:
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.
On the Ada dashboard, go to Build > Answers.
Select or create the Answer you want to put the conditional content 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.
Example:
account_type variable’s value is equal to “gold”; the country variable’s value is equal to “Canada”).account_type variable’s value is equal to “silver”; the account_type variable’s value is equal to “gold”).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.
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.
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.
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.
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:
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: