Saving an Answer in a Variable
To store user input in a variable, configure your User Input block to save the response. This variable can then be reused elsewhere in your Agent Dialog. For example:
Using Variables
Once declared, you can use variables anywhere in your Agent by referencing them with the following syntax:Example:
If a variable namedFirstName
contains “John”, you can display it in a dialog like this:
Secured Varfiables
There are cases where you might want to store sensitive information, such as passwords or personal identifiers. To ensure these variables are not stored in the Submission section, prefix the variable name withsecure_
. For example:

Inline Variable Formatting
Variables can also be formatted directly when referenced. Using JavaScript, you can perform transformations inline. For example:-
Convert to Uppercase:
If
My variable
contains “John”, the output will be “JOHN”. -
Accessing List Items:
- First item:
{{={{My variable}}[0]=}}
or{{={{My variable}}.at(0)=}}
- Last item:
{{={{My variable}}.at(-1)=}}
- First item:
Note: Wrapping the syntax with {{= ... =}}
evaluates the content as JavaScript.
Variables Panel
You can manage variables by accessing the Variables Panel in the editor (top-right corner). In this panel, you can:- Rename, edit, or delete variables.
- Enable the option to save variables in the Submission table for tracking.

Viewing Variables in Results
Variables saved to the results will appear in the Submission table under dedicated columns.Prefilled Variables
You can prefill variables by passing initial values in the URL when launching your Agent. For example:URL Example
Given these variables:Email
First name
Note: Replace spaces in variable names with %20
when using URLs.
Embedding Example
To prefill variables using the embed library:Tip: Surround variable names containing spaces with quotes.
Hidden Variables
Variables do not need to be visible to the user. Hidden variables can be used internally for tracking session details such asUser ID
or utm_source
.
To make a variable hidden:
- Declare it in the Variables Panel or dropdown.
- Exclude it from visible dialogs.
Valid Value Types
Variables can contain:- Text (
string
) - List of Texts (
string[]
)
Examples:
Warning: Non-text content (e.g., objects or numbers) will be automatically converted to text.
Handling Complex Data
To save complex data (e.g., objects), useJSON.stringify
:
Validation and Testing
Before deploying your Agent:- Ensure all variables are correctly saved and referenced.
- Validate inline transformations with JavaScript.
- Check the Submission table for proper tracking.