Triggers are essential components of a call flow. We've introduced them earlier in this chapter, and we'll now delve deeper into their creation and application.
Introduction to triggers - recap
Simply put, triggers set conditions. While they don’t act independently, they are instrumental in introducing advanced logic to your flow. Here's a snapshot of the four triggers needed for the use case discussed in this chapter:
- Calendar check: If a call comes in on a designated holiday, it returns TRUE.
- Verification of business hours: If a call is received inside these hours, it returns TRUE.
- Too many calls waiting: If more than one call is waiting, it returns TRUE.
- Wait time: If the call has been waiting in the queue for more than 30 seconds, it returns TRUE.
These triggers establish conditions. Based on their status (true or false), they guide the direction of a call within your flow.
For a flow to be functional, triggers should be incorporated with other modules or events. Without them, very little can be done in babelforce.
Creating and Configuring Triggers
Navigation and Setup: Start by heading to the
section in the navigation bar. Use the 'Add' button at the top right. Name your trigger and then decide on the logic:
- 'Match ALL conditions': Trigger is activated when all set conditions are met.
- 'Match ANY conditions': Trigger is activated if at least one condition is satisfied
Define Condition: Click on 'Add condition'. You will be prompted to specify:
- Expression: The criterion to be evaluated.
- Operator: The comparison type.
- Expectation: The anticipated result for the condition to hold.
Let's look at the three options in more detail
Grasping the concept of expressions can be initially daunting, but they are crucial to many functions. Every expression signifies a specific value that will be assigned during a call.
A wide variety of expressions is made available to users. For instance, a unique expression is associated with each Business Hour and Calendar (they can be viewed in the drop-down menu). Therefore, expressions can be adaptable and subject to change.
As more business hours are input, an increase in the related expressions can be observed. If distinct Business Hours for offices in New York City and Amsterdam are set, these two expressions might be encountered:
- Business Hours [Office Hours - US/NYC]
- Business Hours [Office Hours - EU/Amsterdam]
Dynamic expressions also exist for other resources, like calendars, queues, or IVR inputs. Moreover, there are ready-to-use expressions focusing on calls and agents.
Operators determine how the expression will be evaluated. Based on the type of operator selected, the user is either asked to enter a condition or not.
You find a table with a list and an explanation of all operators below:
|Checks if a string or sequence contains another substring or element.
|does not contain
|Opposite of contains; checks if a string or sequence does not have a particular substring or element.
|Checks if a string ends with a specified substring.
|is equal to
|Compares two values to see if they are the same.
|Determines if an expression can be evaluated.
|Checks if a value is true or is set.
|is greater than
|Checks if one value is larger than another.
|is greater than or equal to
|Checks if one value is larger than or equal to another.
|is less than
|Compares two values to see if one is smaller than the other.
|is less than or equal to
|Checks if one value is smaller than or the same as another.
|is not equal to
|Compares two values to ensure they are not the same.
|is not evaluable
|Opposite of is evaluable; checks if an expression cannot be evaluated.
|is not given
|Checks if a value is "false" or not set.
|is not null
|Ensures a value is not null or empty.
|Checks if a value is null or empty.
|is similar to
|Checks if a value closely matches or resembles another
|Determines if a string matches a particular pattern
|Checks if a string begins with a specified substring.
Guidance on the Four Triggers needed for the Use Case
For our use case, you will need four triggers. Below, we show you how to set them up.
1. Checking Business Hours
Earlier in this tutorial, we created Business Hours. Now, for the first trigger, we need to link to these defined hours. The purpose of this trigger is to determine whether a call reaches the services during the specified business hours. if this is the case, the trigger returns a "true."
To make this more precise, let's assume opening times for Monday between 9am and 6 pm were defined. If a call reaches the platform on Monday at 10pm, the trigger will return a "false" (and is therefore NOT GIVEN). However, calls received within the set timeframe will return "true" (the Business Hour would in this case be GIVEN).
To set this up:
- Create a new trigger and assign it a descriptive name.
- Add a new condition.
- For the Expression, either type to search for your Business Hours's name or use the "Date and Time" dropdown menu.
- Choose the desired Business Hours from the dropdown list.
- For the Operator, select "is given."
- Save your trigger settings.
2. Setting up a holiday trigger
Just as we set up a trigger for Business Hours, the second trigger pertains to holidays. These are special days or periods when your services might be unavailable, irrespective of regular business hours. When a call comes in on a holiday, even if it's within the usual business hours, the trigger will indicate that it's a non-working day by returning a "true." If no holiday is defined, it will always return "false."
To configure this:
- As with the Business Hours trigger, start by creating a new trigger. This time, you might want to label it something indicative like "Are Holidays given?"
- Proceed to add a condition for this trigger.
- Navigate to the Expression section. Here, instead of selecting Business Hours, you'll be focusing on a specific calendar that lists all the holidays. Using the "Date and Time" dropdown menu, search for and select your holiday calendar.
- Once you've chosen the appropriate calendar, the trigger will reference it to check if the current date matches any special services days you defined.
- As before, for the Operator, opt for "is given" to ensure the system checks the current date against your defined holidays.
- Complete the setup by saving the trigger.
With this trigger in place, any call received on a none-service day will be recognized, allowing you to handle it appropriately, perhaps with a special holiday greeting or redirection.
3. Checking the number of queued calls
The third trigger is designed to monitor the number of calls waiting in a specific queue. babelforce can check the number of calls waiting in a queue. You can define the threshold. In our case, we keep it very small: as soon as 1 call is waiting, we will already redirect the caller to our "sorry" prompt. This means, as soon as 1 calls is waiting, the trigger returns "true."
- Start by creating a new trigger, ideally named "Queued Calls greater than 1"
- Add a new condition to this trigger.
- For the Expression, navigate to "Queue Data" and look for an expression similar to "Queue [yourQueueName] - calls.queued" where [yourQueueName] should be replaced by the name of your specific queue.
- Set the Operator to "is greater than 1" to match our use case.
- Save the trigger.
4. Checking the Queue Wait Time
A last decision point within the use case concerns the time a call is waiting in the queue. You can check the graph in Section 3.0 to remember the flow. In our use case, a call should leave the queue if it waited for more than 20 seconds. The duration is freely configurable. Follow the steps and feel free to adjust any trigger as of your liking.
- Start by creating a new trigger, you could name it "Max. call duration greater 300 sec reached"
- Add a new condition to this trigger.
- For the Expression, navigate to "Queue Data" and look for the expression Call wait time
- Set the Operator to "is greater than 20". However, if you feel like a longer wait time is more appropriate you can adjust the value to anything you consider valid. But keep in mind that testing gets gets prolonged if you have your call waiting for instance for 5 minutes.
- Save the trigger
In our video we explain in more detail what triggers are and how they work:
In the upcoming section, we'll delve into how these defined conditions influence the call's direction in the flow.