Suite | Any plan |
This article includes the following sections:
Branch by condition step basics
When you add a new Branch by condition step to your answer flow, the following settings are included:
- Name that identifies the step on the canvas.
-
Two default branches
that must be configured before the answer
flow can be published:
- If this: If the branch's conditions are met, the conversation follows the branch's steps
- Else: If the conversation doesn't match the conditions of any other branch, the conversation follows this branch's steps
Branch by condition can have up to six branches, including the Else branch. The Else branch is required and cannot be removed from the step. You can add up to four additional branches, to a maximum of six branches.
To add an additional branch, click Add branch and configure the following settings for each branch:
- Name that describes the condition for the branch. This name appears as the branch name on the canvas.
-
Condition
that includes the following elements:
- Variable: The data that will be evaluated to see if the condition is met.
- Operator: How the data from the variable and value are compared. Includes is, is not, contains, and does not contain.
- Value: Value expected for the condition specified by the operator.
See Condition elements for more information.
You can combine conditions for a branch using the AND/OR drop-down. For example, the following branch checks whether a user is located in Australia or the United States.
A conversation can only follow one branch. Branches are evaluated in the order they are included in the step. End users that meet the criteria of more than one branch will be sent down the first branch with matched criteria, from top to bottom in the step's configuration panel or left to right on the canvas. Branches can be reordered by dragging the condition panes on the canvas.
Condition elements
About variables
In a condition, a variable's value is compared to a static value. Variables are added to the condition using a drop-down menu.
For more information about variable types and creating variables, see Using variables to personalize AI agent answers.About operators
The operator determines how the variable's data is compared to the value. Operators are added to a condition using a drop-down menu.
The following operators are available. All operator matching is case-insensitive.
When I’m using the conditional step in bot builder… | Available operators |
---|---|
I want to be able to evaluate data stored as a number |
Operators for Zendesk known use cases for evaluating numbers:
|
I want to be able to evaluate data stored as a string |
Operators for Zendesk known use cases for evaluating strings:
|
About values
A value is static data that's compared to a variable.
It represents the expected data for a variable. For example, in a condition that
checks whether a customer's
membership_status
is "platinum",
"platinum" is the value.
The input field used to specify a condition's value varies based on the variable. For the Authenticated status variable, you specify the condition's value using a boolean drop-down field. For other variables, you specify the condition's value using a text input field.
membership_status
drop-down field accepts a "Platinum
level" value with a related "platinum_level" tag. To check whether the customer
has a platinum membership status, use "platinum_level" as the value in the
condition.
Nested conditions
A nested condition is a condition that contains two or more conditions inside it. You can use nested conditions to build complex logic that relies on multiple conditions. They are especially useful when combining conditions using both AND and OR.
- The user has a “platinum” membership status AND
- The user is located in one of the following countries:
- Australia OR
- The United States
You can only nest conditions up to three levels deep. Each level, including the top level, can contain up to six conditions.
22 comments
Josue Boix Pozuelo
Hello,
I have the same issue that 5104622711706 is describing, but unfortunately the solution from 5935813700634 doesn't work for me.
In my case, “booking_id” is a variable that may be set or not.
When it's not defined, this condition always goes to the wrong side of the tree.
If I print the value afterwards,
I get the following message:
How can this be possible?
0
Jason Kadlec
I plan to set custom fields or tags using the Core API:
zE("messenger:set", "conversationFields", [
{ id: "123456789", value: 100.50 }
])
How do I get the conversationField, or tag to show up in the conditions of the branch by condition?
For ticket fields, I only see email and name.
Messaging Metadata shows only Provided name, Provided email, Authenticated external ID and Authenticated Status.
I know I can set variables using REST api calls to my server, but in this case it's all about what page of my web application the user is on, and/or some button they clicked on, which I need to ‘hard set’ to go to an Answer that is specific to that.
Let's say I have a page of my site called “Playing in sandboxes” and they initiate their chat from this page.
I would
zE("messenger:set", "conversationFields", [
{ id: "123456789", value: sandboxes }
])
And then I would have an answer set as my default_open which would have as the first step a branch by condition which would check for this Ticket Field. If it was “sandboxes” I'm going to route to the answer where the first Send Message says: Hey I see you are playing in the sandbox! Great! Do you have a question for yourself, or your kid?
I don't want to have every interaction with the chat start with “how can I help you” when throughout my app there are pages where.. if the chat is initiated from that page there is a 99% chance I don't need to ask them how I can help.
The specific use case is more like a - click this button to connect to a Sandbox Expert… then the chat bot will load a form which gathers some pre-conversation questions.. then transfers to a live agent.
How do I do this?
0
Martine Hirth
5935813700634 Thank you, it's working now !
0
Viachaslau
5104622711706 It's possible
1
Martine Hirth
Is it planned to add a condition for an empty/ not empty variable? Thanks :)
2
test.zendesk
Thanks for the development on the Zendesk bot so far, it's really nice.
Is it not possible to compare two variables? It is so limited that we have to enter the values to compare with variables manually, what if we want users to make a selection and compare it with the values obtained via API call which is stored in a variable?
0
Stephen White
Looking for some assistance here please. I'm looking to use this feature to validate customer information by comparing two variables.
Email = provided by the customer through ‘ask for details’
customeremail = retrieved through a prior API call and stored as a variable
Is this possible? Or perhaps there's a different way to compare info collected with known information stored from API responses?
1
Viachaslau
We would like this limit to be increased. For example, we have 10 transaction types and need a condition for each, with this limit (maximum 6) we can't create a proper custom flow
0
Dainne Kiara Lucena-Laxamana
Hi Jhamine,
We do offer Answer Bot analytics in Explore but are limited to the following: Analyzing your Flow Builder activity. Hope this helps!
0
Jham Bernardino
I have recently implemented adding conditions to my flow using a dropdown option. Is there a way for the chatbot analytics to capture the choices I added in the dropdown fields? Additionally, how can I track those interactions that did not result in a handover?
0
Sign in to leave a comment.