- 18 Apr 2024
- 6 Minutes to read
- Print
- DarkLight
- PDF
Conditions
- Updated on 18 Apr 2024
- 6 Minutes to read
- Print
- DarkLight
- PDF
Who should read this article: Administrators
The Conditions node helps decide where interactions are routed based on information collected during the flow.
Introduction
Inbound interactions include many different system variables (see the table below) related to interaction properties and the contact. You may also use custom variables, including variables populated by the HTTP Request node, to collect values from a web service and pass them as custom variables (for example, {{customerName}}
).
Use the Conditions node to analyze the values of system and custom variables, then route an interaction based on whether the variables match conditions (1) and its rules (2) specified in the node settings.
When configuring the Conditions node, add one or more conditions you want to analyze. For each condition, specify one or more rules that define the condition. You can specify that the condition matches only when all the rules match or when any individual rule matches.
In the following example, three conditions are defined. When a call enters the flow, an HTTP Request node retrieves some data from a web service.
The data is passed to the Conditions node as a custom variable. The Conditions node checks each specified condition in order from top to bottom:
- If Condition 1 matches, the interaction is routed to a queue using the Route node; otherwise,
- If Condition 2 matches, the interaction is routed to the Send Message node, and an SMS is sent; otherwise,
- If Condition 3 matches, the interaction is routed to another HTTP Request node where information is sent to a web service; otherwise,
- If none of the conditions match (No match), the interaction is routed to voicemail.
Routing is based on the first condition that matches. If none of the conditions match, the interaction is routed by the No match connection.
Connections
The Conditions node supports an unlimited number of input and output connections.
The Conditions node requires at least one input connection and two output connections from the Condition 1 and No match connection.
Use Case: One flow with multiple channels
You can manage multiple inbound phone numbers/channels using a single flow by configuring multiple conditions in a Conditions node to analyze the dialed number (dnis
) system variable. Each condition routes the call to a different call-handling flow.
Use Case: Data-driven routing decisions
Use the HTTP Request and Conditions nodes together to route calls based on data retrieved by one or more HTTP Request nodes from an external web service.
Use the Conditions node to analyze the returned data for one or more custom variables, then apply call-handling logic dependent on the values.
Using the Condition node
To add a Conditions node to your interaction flow, click the Conditions icon:
The Conditions node allows an unlimited number of input and output connections. There should be one output connection for each specified condition plus one No match connection for when none of the specified conditions match.
To make an input connection, drag a link to the Conditions node from any node supporting an output connection.
To make an output connection, drag a link from the Conditions node to any node supporting an input connection.
The Conditions node has two output connection types: Condition (match) and No match. These connections represent one of the two possible outcomes for the node when a condition is analyzed. By default, the Conditions node includes one condition and one No match. An additional output connection is added for each condition you add to the node.
Variable types and comparison operators
The Conditions node supports both system and custom variables.
Variable | Description | Example |
---|---|---|
{{start_time}} | The time the interaction started. | 2023-08-21T04:02:18Z |
{{ani}} | The calling number (ANI). | 443336006114 |
{{dnis}} | The number dialed (DNIS). | 380631234567 |
{{phone_type}} | The type of phone for the ANI. | fixed_line |
uuid | a string containing the UUID of the interaction | 07771c38-c159-4965-a878-be0162118b2b |
Different comparison operators are available, depending on the data type. The following data types are supported:
- string (
ani
,dnis
,phone_type
,uuid
, and custom variables) - number (custom variables)
- date and time (
start_time
and custom variables)
String
Operator | Description |
---|---|
Contains | The value of the variable includes the specified string. |
Does not contain | The value of the variable does not include the specified string. |
Equals | The value of the variable is exactly the same as the specified string. |
Doesn't equal | The value of the variable is not exactly the same as the specified string. |
Starts with | The value of the variable begins with the specified string. |
Ends with | The value of the variable ends with the specified string. |
Empty | The variable contains no value. |
Not empty | The variable has some value. |
Number
Operator | Description |
---|---|
Equals | The value of the variable is exactly the same as the specified number. |
Doesn't equal | The value of the variable is not the same as the specified number. |
More than | The value of the variable is greater than the specified number. |
Less than | The value of the variable is less than the specified number. |
Empty | The variable contains no value. |
Not empty | The variable contains some value. |
Date
Operator | Description |
---|---|
Equals | The value of the variable is exactly the same as the specified date and time. |
Doesn't equal | The value of the variable is not the same as the specified date and time. |
Between | The value of the variable is a date and time between the two specified dates and times. An additional field appears when selecting the Between option, enabling you to specify a date range. |
After | The value of the variable is a date and time that occurs after the specified date and time. |
Before | The value of the variable is a date and time that occurs before the specified date and time. |
Configuring the Condition node
Click a Conditions node to display the Conditions node configuration panel.
Conditions
For each condition you create, specify one or more rules defining the condition.
- Click All rules to indicate that the condition is matched only when all the rules are met.
- Click Any rule to indicate that the condition is matched if at least one of the rules is met.
To add another condition, click Add condition.
To remove a condition, click the 'X' on the top right of the condition.
If you have only one condition, it cannot be removed. You may only remove the first condition if you have two or more conditions.
Rules
Each condition must have at least one rule. There is no limit to the number of rules you can specify for a condition.
Configure a rule by using the three fields:
- Variable (includes system and custom variables)
- Operator (analyzing the value of the variable)
- Value (the data contained in the variable)
To define variables and operators, select them from the drop-down menus. To define a value to be compared against the value of the specified variable, manually enter it in the Value field.
To specify another rule for a condition, click Add rule inside that condition.
To remove a rule, click the 'X' next to the rule.
If you have only one rule, it cannot be removed. You may only remove the first rule if you have two or more rules.