Skip to main content

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 page, or contact your Ada team.

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:

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

Insert the Conditional block

  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 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”).

    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 bot wouldn’t accept word , WORD, or wOrd as matches.

    5. To add additional criteria, click the Add button 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 and repeat steps 3-4. Additional conditions are indicated with the 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 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:

OperatorVariable typesDescription

Begins With

  • All text variables (including phone and email)

Match information in the variable that begins with certain text (partial match).

Ends With

  • All text variables (including phone and email)

Match information in the variable that ends with certain text (partial match).

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

  • All text variables (including phone and email)

  • Number variables

Match information in the variable that equals specific text exactly (exact match).

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

  • All text variables (including phone and email)

  • Number variables

  • List variables

Match if there is no information contained in the variable.

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

  • Number variables

Match if the information in the variable is greater than a specific value.

Less Than

  • Number variables

  • List variables

Match if the information in the variable is less than a specific value.

Is True

  • Yes/No variables

Match if the information in a variable is Yes (or True).

Is False

  • Yes/No variables

Match if the information in a variable is No (or False).

Does Not Contain

  • List variables

Match if none of the selected items contains this value.

Is Equal To

  • List variables

Match if the chatter selected a particular number of options in a List Option block.

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

  • List variables

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 .