- On the left-hand side field, you should assign the name of the variable. You need to prefix it with the dollar sign ($). For example: $age
- On the right-hand side field, you should define the value of the variable. Here, you can even include arithmetic operations to obtain a specific result, such as calculating the customer’s age based on their inputted date of birth. In this field, you can also assign a text value as long as it is enclosed in single quotation marks (‘ ‘). For example: ‘Text’
Example #
The objective of this example is to apply a discount percentage on the price of a product depending on the customer’s age. This can be done without the need for the agent to ask the customer’s age directly. Instead, the customer will enter their year of birth, and their age will be calculated based on that information and the current year. The customer’s age will determine the total discount they receive. Therefore, when the call is transferred to the agent, they will already know the percentage of discount the customer is entitled to and will proceed to inform the customer accordingly.
In the following example, the “Variable Computation” component has been used to perform an arithmetic operation. Initially, through another component, the customer has been asked to enter their year of birth, and this value has been assigned to a variable called “$nacimiento” (birth year). Then, in the “Variable Computation” component, a variable called “$edad” (age) has been created, and its expression field contains an arithmetic operation that calculates the customer’s age by subtracting their year of birth from the current year.
This component allows you to create or select a variable and assign it a value of text or numeric type. You can even add an arithmetic operation expression to obtain a specific result.
It is located within the group of components called “Basics” and is available in all types of routing (“Voice”, “Interaction”, “Chat”, and “CRM + webhook”) as well as in Agent Scripting.
Configuration #
- On the left-hand side field, you should assign the name of the variable. You need to prefix it with the dollar sign ($). For example: $age
- On the right-hand side field, you should define the value of the variable. Here, you can even include arithmetic operations to obtain a specific result, such as calculating the customer’s age based on their inputted date of birth. In this field, you can also assign a text value as long as it is enclosed in single quotation marks (‘ ‘). For example: ‘Text’
Example #
The objective of this example is to apply a discount percentage on the price of a product depending on the customer’s age. This can be done without the need for the agent to ask the customer’s age directly. Instead, the customer will enter their year of birth, and their age will be calculated based on that information and the current year. The customer’s age will determine the total discount they receive. Therefore, when the call is transferred to the agent, they will already know the percentage of discount the customer is entitled to and will proceed to inform the customer accordingly.
In the following example, the “Variable Computation” component has been used to perform an arithmetic operation. Initially, through another component, the customer has been asked to enter their year of birth, and this value has been assigned to a variable called “$nacimiento” (birth year). Then, in the “Variable Computation” component, a variable called “$edad” (age) has been created, and its expression field contains an arithmetic operation that calculates the customer’s age by subtracting their year of birth from the current year.
This component allows you to create or select a variable and assign it a value of text or numeric type. You can even add an arithmetic operation expression to obtain a specific result.
It is located within the group of components called “Basics” and is available in all types of routing (“Voice”, “Interaction”, “Chat”, and “CRM + webhook”) as well as in Agent Scripting.
Configuration #
- On the left-hand side field, you should assign the name of the variable. You need to prefix it with the dollar sign ($). For example: $age
- On the right-hand side field, you should define the value of the variable. Here, you can even include arithmetic operations to obtain a specific result, such as calculating the customer’s age based on their inputted date of birth. In this field, you can also assign a text value as long as it is enclosed in single quotation marks (‘ ‘). For example: ‘Text’
Example #
The objective of this example is to apply a discount percentage on the price of a product depending on the customer’s age. This can be done without the need for the agent to ask the customer’s age directly. Instead, the customer will enter their year of birth, and their age will be calculated based on that information and the current year. The customer’s age will determine the total discount they receive. Therefore, when the call is transferred to the agent, they will already know the percentage of discount the customer is entitled to and will proceed to inform the customer accordingly.
In the following example, the “Variable Computation” component has been used to perform an arithmetic operation. Initially, through another component, the customer has been asked to enter their year of birth, and this value has been assigned to a variable called “$nacimiento” (birth year). Then, in the “Variable Computation” component, a variable called “$edad” (age) has been created, and its expression field contains an arithmetic operation that calculates the customer’s age by subtracting their year of birth from the current year.