- Assign predefined values or custom values to variables.
- Manipulate variables using JavaScript expressions.
- Transform variables for specific operations (e.g., calculations, string transformations).
- Fetch specific data from lists using index mapping.
- Reset or append values to variables dynamically during execution.

Custom Values
You can set a variable with:- Plain text (e.g.,
Welcome to our service!
). - Dynamic JavaScript code for advanced operations.
Note: If the return
keyword is omitted, it is automatically added.
Expressions with Existing Variables
Apply operations directly on variables to compute new values. Examples:-
Add a Value to a Variable:
-
Compute a Sum of Variables:
-
Extract First Name from Full Name:
-
Transform to Uppercase:
Predefined Value Options
Empty
Resets the variable to its uninitialized state.Append Values
Converts the variable into a list and appends new values.Environment Name
Sets the variable asweb
or whatsapp
based on the user’s platform.
Transcript
Saves the conversation transcript into a variable. Useful for sending recaps or providing AI context.Result ID
Assigns the unique ID corresponding to the current user interaction.Random ID
Generates a unique ID using the CUID algorithm.Pop
The Pop operation removes the last item from the list variable you provide, and stores that item in the Popped item variable. It is particularly useful when you want to build a loop that processes list items one by one.Shift
The Shift operation removes the first item from the list variable you provide, and stores that item In the Shifted item variable. It is particularly useful when you want to build a loop that processes list items one by one.Moment of the Day
Sets the variable with values like:morning
afternoon
evening
night
Advanced Operations
Map Item with Same Index
Fetch data from a corresponding index in two parallel lists. Example:- Scenario: You have two lists:
Labels
:[Action, Drama, Comedy]
IDs
:[123, 456, 789]
- When the user selects “Drama,” the variable
Selected ID
is set to456
.
Date and Time Presets
Assign date values:Yesterday
,Now
, orTomorrow
in ISO format.- Optional timezone adjustments.
Client-Side Execution
Run custom JavaScript on the user’s browser to access client-specific properties. Example: Fetch the user’s geolocation:Note: Enable “Execute on Client” to use browser-specific features.