How to Use the 'Variable Computation' Component in wolkvox Studio
Table of Contents
Introduction
The Variable Computation component allows you to create a variable and assign it a numerical or text value, as well as perform arithmetic operations to obtain specific results within a flow. It is one of the most versatile components in the “Basics” group and is available in all types of routing and Agent Scripting.
It is ideal for calculations, information transformations, value assignments, and data preparation before sending them to other components, APIs, or agents.
Configuration
The component consists of two fields:
-
Target variable: It is the name of the variable you want to create or update. It must mandatory begin with the $ sign.
- Valid examples:
- $age
- $final_price
- $customer_type
- Valid examples:
-
Expression: It is the value or calculation that the variable will hold. It can be:
- A numerical value
- 10
- A text
- ‘Welcome’
- An arithmetic operation
- 2025 - $birth_year
- A combination of variables and numbers
- $quantity * $unit_value
- A text concatenation
- 'Customer: ' + $name
- A numerical value
- Once both fields are defined, you must click on “Save computation expression”.
