Condition widget

Summary

This widget is used to control call routing to different flow paths based on if-then conditions. It sends the caller down specific flow path based on the value of the variable and its related conditions. You can evaluate variables against constant plain text value or other variables to conditionally route calls. Available operators - “is equal to”, “is not equal to” and “contains”

How it works

  • Use case 1- Geo routing
    • Route the calls based on the country code of caller id / call from number
    • From number is an internal variable which contains the callers number as its value
    • Compare <call.from.number> to specific country codes - Example:
      • United States - <call.from.number> “contains” “+1” // route to “US team”
      • South Africa - <call.from.number> “contains” “+27”  // route to “SA team”
      • United Kingdom- <call.from.number> “contains” “+44”  // route to “UK team”
  • Use case 2 - Conditionally route the call based on customer id entered by caller
    • Caller is prompted to enter their 4 digit customer id
    • Make a API call to CRM to validate the customer id using webhook widget
    • Capture the value returned from webhooks into variable - <isCustomerIdValid>
      • Let's assume webhook returns “true” for valid customer and “false” for invalid customer
    • Use condition widget - Compare <isCustomerIdValid> to constants true/false
      • <isCustomerIdValid> “is equal to (==)” “true” //route to “Support team”
      • <isCustomerIdValid> “is equal to (==)” “false” // play message “Customer Id entered is incorrect. Please re-enter your customer id”
  • Use case 3 - Conditionally route call based on passcode entered by caller
    • Caller is prompted to enter their 4 digit passcode
      • Collect user input using gather input widget
      • callers input will be stored in variable <passcode>
    • Use condition widget - Compare <passcode> to constant - correct passcodes
      • <passcode> “is equal to (==)” “7687” // route to “Team X”
      • <passcode> “contains” “1234” // route to “Team Y”
      • <passcode> doesn't match with above condition - play message “Incorrect passcode, please re-enter you passcode to proceed"

Configuration

You can evaluate variables within the flow to conditionally route calls.

A Variable to compare can be chosen from the list of user defined variables or internal call variables available in the dropdown “Variable to compare”.

The variables will be compared to constants/plain text value or other variables using if then logic conditions

For comparison any one of these operators can be chosen

  • “is equal to” - values are equal
    • Example - <isCustomerIdValid> “is equal to” 1 // check if customer is valid or not
  • “is not equal to” - values are not equal
    • Example - <isCustomerType> “is not equal to” Gold // check if customer type is not Gold
  • “contains” - Value contains the value given.
    • Example - <call.from.number> contains +1 // Geo routing
    • Note - comparison is case sensitive

Condition paths - You can configure multiple condition paths. To add conditions click on the “+Add Condition” button present at the bottom left of the widget config panel.

By default, there will always be a “No Match” path. This path will be chosen when none of the configured conditions are met/satisfied.

Note: condition paths will execute individually in order of configuration from left to right as present on canvas or from top to bottom as present in widget config panel.

Field Name Description Configuration Sample values

Name

*Required Field

Friendly name for your Condition widget. Text input Validate customer Id

Variable to compare

*Required Field

user defined variables or internal call variables. Check out full list of internal variables here. Dropdown

<isCustomerIdValid>

<call.from.number>

 

Condition path name Friendly name for your Condition path Text input

Customer type Gold

Customer type Silver

Operator List of available operators Dropdown

is equal to (==)

Is not equal to (!=)

contains

Value to be compared Constant or variable Text input/ dropdown of available variables

Constants

  • 1
  • Gold

Variables

  • <isCustomerIdValid>

Video guide

Call variable list

These variables can be sent in 

  • Webhooks
    • request body of post request
    • Parameters
    • Headers
  • Used in condition widget to route calls

Call variable name

Sample values

Usage

call.callId

fd1xyz61-8xf9-128f-8abc-9ca2773c7ce1

 

call.from.number

Callers from number - +16176545678

 

Internal extension - 2345 // internal call placed from AVOXI webphone

<call.from.number>  “is equal to” +16176545678

call.from.friendlyName

Sales team

<call.from.friendlyName>  “is equal to” Sales team

call.to.number

Callers from number - +16176545678

Internal extension - 2345

<call.to.number> “is equal to” +16176545678

call.callStatus

0

 

Available mid call

 

0: 'In Progress',

1: 'Answered',

2: 'Unanswered',

3: 'Voicemail',

<call.callStatus> “is equal to” 0

call.tags

friendlyName: ‘English’

<call.tags> contains  friendlyName: ‘English’

call.callStart

'1701809289'

 

Timestamp

 

call.callDuration.Sec

12 (seconds)

Available mid call

 

Other internal variables

  1. Variable name -  webhook_widget_name_tries
    1. Description - This represents number of times a webhook is executed during call flow.
    2. Sample values - 1, 2, 3
    3. Sample use case -  When a caller calls in for support services for their booking, give callers 3 attempts to enter booking ID
      1. By checking the number of times flow tries to fetch caller's booking details by making webhook call to booking system, the number of attempts given to the caller can be controlled with condition widget by checking the value of webhook_widget_name_tries variable. Read more about this use case here.

 

Give feedback about this article

Was this article helpful?

Have more questions? Submit a request

Updated:

August 20th, 2024

Author:

Tasleem Rayali

Updated By:

Tasleem Rayali

KB ID:

2332971

Page Views:

1351

Tags:

condition, compare, api, webhook

Can’t find what you’re looking for?

Contact our award-winning customer care team.