How to Use the 'Functions' Component in wolkvox Studio
Table of Contents
Introduction
The **"Functions" (F(X))** component in wolkvox Studio allows you to execute native PHP functions within any routing point. With it, you can validate data, transform values, manipulate strings, work with dates, perform numerical operations, handle arrays, and much more—all without the need to manually write code.
This component is available in all types of routing and also in **Agent Scripting**.
Below, you will learn how to configure it correctly, how its syntax works, and how to use it in a real flow.
Configuration
From the **Basics** section, drag the **Functions** component to the routing point canvas.
- In the **"Select Function"** field, choose the PHP function you want to use. Click **"Add"** to send it to the preview on the right.
- Note: wolkvox Studio only allows the use of functions included in its internal list. Not all PHP functions are available in this component.
- For more official information about each function, you can consult the official documentation by [clicking here].
- In the **"Parameter"** field, enter the value or variable that will serve as the function's argument (e.g.,
$txt_query). Click **"Add"** to include it in the function structure. - If you need to close parentheses, use the **"("** button.
- If you want to delete the last element, use the **"◄◄"** button.
- In the **"Destination Variable"** field, enter the name of the variable where you want to store the function's result.
- Verify that the black box (preview) displays your function correctly.
- Click **"Add Function"**.

The added function will appear in the table below, in columns:
- Target variable
- Function
You can edit already created functions:
- Right-click on any added function. Select from the options:
- MOVE UP: Change the execution order.
- MOVE DOWN: Move it down.
- EDIT: Open the structure to modify it.
- DELETE: Remove the function from the routing.
When all functions are ready, click **"Save Functions"**.

Complete List of Available Functions
Includes functions for array handling, strings, data types, validation, dates, numbers, hashing, JSON, and more.
Here is a quick reference:
Validation and Data Types
These functions allow you to verify the type or state of a variable.
| Function | Description |
|---|---|
| empty | Determines whether a variable is empty (does not exist, is false, null, 0, or an empty array). |
| isset | Checks if a variable is defined and not NULL. |
| is_array | Checks if a variable is an array. |
| is_numeric | Checks if a variable is a number or a numeric string. |
| is_string | Checks if a variable is of type string. |
JSON and Encoding
For handling data interchange formats and security.
| Function | Description |
|---|---|
| json_encode | Returns the JSON representation of a value. |
| json_decode | Decodes a JSON string. |
| base64_encode | Encodes data with MIME base64. |
| base64_decode | Decodes data encoded with MIME base64. |
| urlencode | URL-encodes a string. |