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:

  1. Create a condition. On the dashboard, your first condition is indicated with the 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 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_type variable’s value is equal to “gold”; the country variable’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_type variable’s value is equal to “silver”; the account_type variable’s value is equal to “gold”).
    2. Choose a variable to use as a basis of comparison. There’s no limit to the number of variables you can use.

    3. 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.

    4. 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 accept word, WORD, or wOrd as matches.
    5. To add additional criteria, click the Add button and repeat steps ii-iv.

  2. 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.

  3. To add additional conditions, click the Add Condition button and repeat steps a - b. Additional conditions are indicated with the symbol.

  4. 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:

OperatorVariable typesDescription
Begins With icon Begins WithAll text variables (including phone and email)Match information in the variable that begins with certain text (partial match).
Ends With icon Ends WithAll text variables (including phone and email)Match information in the variable that ends with certain text (partial match).
Contains icon ContainsAll text variables (including phone and email), List variablesMatch information in the variable that contains certain text in any position (partial match).
Is icon IsAll text variables (including phone and email), Number variablesMatch information in the variable that equals specific text exactly (exact match).
Is Not icon Is NotAll text variables (including phone and email), Number variablesMatch information in the variable that does not equal specific text exactly (exact match).
Is Not Set icon Is Not SetAll text variables (including phone and email), Number variables, List variablesMatch if there is no information contained in the variable.
Is Set icon Is SetAll text variables (including phone and email), Number variables, List variablesMatch if there is any information contained in the variable.
Greater Than icon Greater ThanNumber variablesMatch if the information in the variable is greater than a specific value.
Less Than icon Less ThanNumber variables, List variablesMatch if the information in the variable is less than a specific value.
Is True icon Is TrueYes/No variablesMatch if the information in a variable is Yes (or True).
Is False icon Is FalseYes/No variablesMatch if the information in a variable is No (or False).
Does Not Contain icon Does Not ContainList variablesMatch if none of the selected items contains this value.
Is Equal To icon Is Equal ToList variablesMatch if the customer selected a particular number of options in a List Option block.
Is Greater Than icon Is Greater ThanList variablesMatch if the customer selected more than a particular number of options in a List Option block.
Is Less Than icon Is Less ThanList variablesMatch if the customer selected fewer than a particular number of options in a List Option block.