Conditional block
With Conditional blocks, you can target specific content to different customers depending on variables associated with them.
You can’t use variables from your Actions when you’re setting conditions. This is because you can’t control when your customer might trigger an Action, so you can’t depend on your AI Agent having that information when it needs to use it.
The Conditional block uses logic to decide whether it should serve content to customers. Sometimes this is called “if-then-else” logic. Here’s how it works in Ada:
- If statement: Set up the criteria your AI Agent uses to decide whether to serve the customer 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 customer takes if the user meets the criteria.
- For each If statement you create, drag in content blocks to serve to customers who meet that condition. If a customer doesn’t meet the criteria, the AI Agent moves on to the next condition and tries again, until it reaches the Else condition.
- Else action: Set up the action your customer takes if none of the above if statements apply. If you don’t set up an Else action, the AI Agent effectively doesn’t have any instructions, and doesn’t perform any of the actions in your Conditional block.
Create conditions to create targeted content
To start using the Conditional block in your handoff content, add the Conditional block and follow these instructions:
-
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 your AI Agent serves the content for this condition or if it moves on to the next condition.
Example:
- You want to send a message to customers 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_typevariable’s value is equal to “gold”; thecountryvariable’s value is equal to “Canada”). - You want to send a message to customers who have either silver or gold level accounts. In this case, you select If any of, and you create two criteria (the
account_typevariable’s value is equal to “silver”; theaccount_typevariable’s value is equal to “gold”).
- You want to send a message to customers 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
-
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 AI Agent wouldn’t acceptword,WORD, orwOrdas matches.
-
To add additional criteria, click the Add button
and repeat steps ii-iv.
-
-
Under the condition you just made, drag and drop blocks that you want those customers to see.
You can’t drag and drop Conditional 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 AI Agent, contact your Ada team for assistance.
-
To add additional conditions, click the Add Condition button
and repeat steps a - b. Additional conditions are indicated with the
symbol. -
Lastly, it’s a good idea to set up an else condition, so customers 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 customer information that’s captured in the variable you’re using. The available operators vary based on the variable type you’re using: