What's my plan?
Add-on AI agents - Advanced

This article gives you an overview of what Conditional Blocks are and how to set them up with examples.

  • What are Conditional Blocks?
  • Parameters
  • Use Case Examples & Best Practices

What are Conditional Blocks?

Conditional Blocks are the way to personalize messages in your dialogue flows based on a certain condition, or in this case, a parameter. This is a more elevated approach than using buttons and checking for Intents to divert users to more specific and relevant communication.
It works by setting a parameter to be checked, as well as conditions that check for one or more parameter values based on the selected operator.

Example

Conditional_blocks.png
In the example above, we are sending different messages to customers based on their location. 
To set this up: 
  1. Add "Get Customer Info" action in Settings > Actions.
  2. Add a conditional block in the dialogue flow of the intent of your choice and enter the parameter you want to use. We are using Country in this example.
  3. Create different conditional paths by adding conditions. In the example above we have Germany and Japan as the conditions using operator Is, and a fallback path using operator Else.
    • You can also add another condition right after the other to check for other parameters to make your messages more sophisticated. For example device type. 
      Inserting_Conditional_Blocks.gif
Note that the system checks the conditions from left to right - just like other parts of our Dialogue Builder. This is why the fallback condition, or the broadest condition you have, should always be on the furthest right.

Parameters

Parameters can come from three sources:

  • CRM platform
  • Session data
  • Backend integration

Types of operators accepted in conditional blocks

  • Strings - words
  • Boolean - true/false
  • Array/list - comma-separated list
  • Integers - a whole number
  • Floats - a decimal number

CRM Platform

CRM platforms typically store customer information such as name, email, location, etc. This information can be fetched from your CRM platform and saved as parameters to use for Conditional Blocks.

To fetch the information from your CRM platform, add an action to get customer information on the Chat Started event. This means the information will be collected for every new conversation and applied to all dialogues in your AI agent. 

Session Data

Session data refers to the information customers offer during a chat session with the AI agent. At almost every point in any dialogue flow, as well as any reply, you can create custom actions to fetch session data and save it as a parameter.

We also have parameters that are collected by default.

Parameter Example
{{lastDetectedLanguage}} Use within the unsupported language reply to differentiate based on the language someone writes in to say that service is not offered in that language and they can select which language they want in a way that is easy for them to understand.
{{active_language}}

This can be used to have language-specific replies in one reply or to direct people to the correct language template. You can find examples of language settings here

 

active_language.png

{{chatTranscript}} Attach the chat transcript to tickets within the escalation via email method.
{{lastCustomerMessage}}

Predominantly used to enrich the default reply to play back what a person says, such as;

“I’m afraid I don’t know anything about {{lastCustomerMessage}} yet”

{{integrationId}} Route incoming chats to relevant AI agents by defining routing rules. Through the routing rule, users can define conditions based on the source of the incoming chat (akaintegrationId)

Screenshot_2022-12-05_at_15.44.18.png
{{confidence_score}}

This is used to differentiate how or whether you reply based on the intent recognition confidence threshold. 

Example: Ticket Automation - For confidence above 69 then send the reply, above 59 send a different reply, above 49 add tags.

This means your global confidence thresholds can be lowered as you can differentiate based on the scores - especially when there is some more training needed on certain intents to add more expressions.

Note - confidence_score should be set with whole numbers (integers). If something has a confidence of 67.5 it would round up to 68 and on the other side, if it was 67.4 it would round down.

Screenshot_2022-12-16_at_13.59.13.png

{{lastResolution}}

This enables you to use the last resolution state in conditional flows separated based on the following values: Undefined , Informed , Resolved , Not Resolved , Escalated To Agent , Escalated via Email

Example use cases for this would be to differentiate conversation dialogues based on the current resolution a customer is in - such as when you move to a Template reply.

In addition you can send this as a tag to your CRM upon escalation.

When creating your own session parameters with an action, do not use the same name as one of these system parameters as it will cause an error and that data won't be retrieved.

Entities are considered session data parameters as well and the name of each entity is a parameter. Any data captured via entities are stored as session data until two hours after chat inactivity.  

Backend Integrations

This means if you have custom API integration built with us, the AI agent can fetch any information from your back office system to create personalized dialogues flow based on your needs. 

To learn more, get in touch with your Customer Success Manager or submit a request.

Operators

Operator Definition Example Expected Parameter Value Condition Value
Is /
 Is not
Use this for single values

Country is Germany

string

string or integer

Is /
 Is not (boolean)
 
Use this for true or false statements

loggedIn is True

boolean

boolean

In / Not in This acts as an OR condition. Use this for multiple values, separated by a comma

Country in Germany, Japan, Finland

string 

array

Array includes /
 does not include
Use this for a list of values. It will expect an array in the session and a single value in the condition. 

tags_Array Array includes item VIP

array

string

Text includes /
 does not include
Use this to find substrings in a text, like a country code in a URL. It will expect a string in the session. URL Text includes fr string string

Exists /

Does not exist

Use this to check if a parameter is present in the session

This is triggered when the value expected for the parameter is empty

Email Exists 

 

country: '' , null or completely undefined.

anything

N/A

Starts with /   Does not start with

Use this for single string values

Country starts with united

string

string

 

 

Greater than 

 

Greater than or equal

 

Less than 

 

Less than or equal

This works with all number types (integers & floats) with content recognition and actions.

Differentiate whether a value exceeds a set value

Differentiate whether a value exceeds or is equal to a set value

Differentiate whether a value is fewer than a set value

Differentiate whether a value is fewer or equal to a set value

Number Less than or equal 9 integer or float integer or float
Else The fallback. This should always be added as the last condition N/A anything N/A

Parameter Values

Each parameter can carry none, one or more values. Meaning for parameter Country, the values could be:

  • None -  , null
  • One - Germany
  • Many - Germany, Japan, Finland

It's important to understand what are the possible scenarios when outlining the conditional blocks, especially if you are using API-returned values.

Use Case Examples & Best Practices

Avoid Loops

Loops are usually not helpful, as if a customer has been through a path once, they likely need more information in order to be successful in the request that is being asked of them or get the answer they need. 

This helps personalize the customer experience to achieve the best result. You may wish to avoid the same conversation loop and help customers get to a set destination faster, for example, if they ask to speak to an agent. The first time they try to force the intent to speak to a human - you may want to say why they should give the AI agent a chance, but once they have passed that they can trigger it again and not have that same response. You can then create a parameter that you can then look for so you don't duplicate responses/create a loop

Screenshot_2022-08-12_at_13.54.37.png

Screenshot_2022-08-16_at_09.16.03.png

Entity Lists

In case you prefer not to/can't use buttons conditional blocks are great to use for different use cases such as contact methods where you are unlikely to train a specific Intent. By using lists you can segment information and then take users down a more specific/personalized path.  The example below is based on contact methods, however, you could have another based on where a user is having the issue, is it an iOS or Chrome issue. By loading a list of browsers and operating systems you can personalize troubleshooting help.

Screenshot_2022-08-12_at_13.56.11.pngScreenshot_2022-08-12_at_13.55.32.png

Personalize on Customer Type/Value

Depending on the type of customer that is contacting there may be different procedures or policies, such as merchant vs premium or new customers. Therefore, by pulling this information you can provide a more accurate and appropriate experience based on customer lifetime value or business relationship. An example of this is by pulling the organization information if you are servicing B2B, B2C or D2C use cases - in the screenshot below with Zendesk - this can then be split with the orgCustom parameter. 

Screenshot_2022-08-19_at_12.33.07.png

API Integration Value Personalization

Further personalize AI agent responses based on customer-specific information returned which can be pretty much everything, depending on the use-case, API, and information available to us. Such as; Parcel Status is “Shipped”  + Courier is “DHL” + Shipping Mode is “Express”

Firstly, here you can provide more accurate information to the user, but also in the example of express shipping if you just return the value of shipped, you might provide a generic response like "please allow 2-5 days for your order to reach you" that could end up causing customer dissatisfaction when they are either a premium customer that gets it as part of a loyalty scheme or they personally paid for 1-day delivery. 

Preferred Language Detection

When someone is on your help center looking at content in a certain language, it is great to be able to keep a seamless experience by maintaining the language they are seeing the page in.

An example of this is using the get tag depending on which help center the widget is loaded within.

Screenshot_2022-08-16_at_09.30.48.png

We have an action for chat started to get Tags and then use those tags to trigger the correct language. The below screenshots are with Zendesk as an example.

Screenshot_2022-08-16_at_09.30.08.pngScreenshot_2022-08-16_at_09.27.33.png

Number Conventions

There are different examples where numbers are specific to a product (brand-based SKU's, destinations), country (such as postal code or phone number), or some kind of convention you have implemented at your business (regional or premium order numbers). This is where the starts with operator is great for personalizing communication. 

Brand Specific Information

Depending on the type of product that a customer is asking about, you may have specific merchandising agreements that entitle the user to more specific support, and thus you may want to split this based on a conditional block on the brand level. Depending on the Intent you might have responses you might want to provide, such as Care Instructions, Damaged Product, and Pre-Order. 

Screenshot_2022-08-22_at_09.16.21.png

 

Powered by Zendesk