This article gives you an overview of what Conditional Blocks are and how to set them up with examples.
What are Conditional Blocks?
Example
- Add "Get Visitor Info" action in Settings > Actions, in Ultimate's Dashboard.
- 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. -
Create different conditional paths by adding conditions. In the example above we have
Germany
andJapan
as the conditions using operatorIs
, and a fallback path using operatorElse
.
- 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.
- 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.
Parameters
Parameters can come from three sources:
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 chat visitor 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 visitor information on the Chat Started event. This means the information will be collected for every new conversation and applied to all dialogues in your bot.
Session Data
Session data refers to the information chat visitors offer during a chat session with the Virtual 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
|
{{chatTranscript}} | Attach the chat transcript to tickets within the escalation via email method. |
{{lastVisitorMessage}} |
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 {{lastVisitorMessage}} yet” |
{{integrationId}} |
Route incoming chats to relevant virtual agents by defining routing rules. Through the routing rule, users can define conditions based on the source of the incoming chat (akaintegrationId ) |
{{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. |
{{lastResolution}} |
This enables you to use the last resolution state in conditional flows separated based on the following values: 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.
Content Entities are considered session data parameters as well and the name of each content entity is a parameter. Any data captured via content 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 bot 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 / |
Use this for single values |
|
string |
string or integer |
Is / |
Use this for true or false statements |
|
boolean |
boolean |
In / Not in |
This acts as an OR condition. Use this for multiple values, separated by a comma |
|
string |
array |
Array includes / |
Use this for a list of values. It will expect an array in the session and a single value in the condition. |
|
array |
string |
Text includes / |
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 |
|
Use this to check if a parameter is present in the session This is triggered when the value expected for the parameter is empty |
|
anything |
N/A |
|
Use this for single string values |
|
string |
string |
|
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 bot 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
Content 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.
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.
API Integration Value Personalization
Further personalize bot 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.
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.
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.