Conditions
    • 18 Apr 2024
    • 6 Minutes to read
    • Dark
      Light
    • PDF

    Conditions

    • Dark
      Light
    • PDF

    Article summary

    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.

    Flow Builder Conditions Node Example Conditions and Rules Revised

    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.

    Flow%20Builder%20Conditions%20Node%20Flow%20Example

    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.
    Important

    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.

    Important

    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.

    Flow Builder Condition Node One Flow With Multiple Channels Revised

    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.

    Flow Builder Condition Node Testing HTTP Request Variable Revised

    Using the Condition node

    To add a Conditions node to your interaction flow, click the Conditions icon:

    Flow%20Builder%20Condition%20Node

    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.

    Flow%20Builder%20Condition%20Node%20Connections

    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.

    Flow%20Builder%20Conditions%20Node%20Making%20Connections

    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.

    The following four system (global) variables are available:

    VariableDescriptionExample
    {{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

    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

    OperatorDescription
    ContainsThe value of the variable includes the specified string.
    Does not containThe value of the variable does not include the specified string.
    EqualsThe value of the variable is exactly the same as the specified string.
    Doesn't equalThe value of the variable is not exactly the same as the specified string.
    Starts withThe value of the variable begins with the specified string.
    Ends withThe value of the variable ends with the specified string.
    EmptyThe variable contains no value.
    Not emptyThe variable has some value.

    Number

    OperatorDescription
    EqualsThe value of the variable is exactly the same as the specified number.
    Doesn't equalThe value of the variable is not the same as the specified number.
    More thanThe value of the variable is greater than the specified number.
    Less thanThe value of the variable is less than the specified number.
    EmptyThe variable contains no value.
    Not emptyThe variable contains some value.

    Date

    OperatorDescription
    EqualsThe value of the variable is exactly the same as the specified date and time.
    Doesn't equalThe value of the variable is not the same as the specified date and time.
    BetweenThe 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.
    AfterThe value of the variable is a date and time that occurs after the specified date and time.
    BeforeThe 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.

    Flow Builder Conditions Node Add Condition Revised

    To remove a condition, click the 'X' on the top right of the condition.

    Tip

    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.

    Flow Builder Conditions Node Configuring A Rule Revised

    To specify another rule for a condition, click Add rule inside that condition.

    Flow Builder Conditional Node Add Rule Revised

    To remove a rule, click the 'X' next to the rule.

    Tip

    If you have only one rule, it cannot be removed. You may only remove the first rule if you have two or more rules.


    Was this article helpful?