Variables
Yola Variables store and retrieve information during a chatbot interaction, such as user input, customer details, and communication channel information. These variables can be used across bot actions to dynamically display or manipulate data.
Using Variables in Bot Actions
Variables are applied differently depending on the bot action:
Bot Actions That Require Delimiters e.g.{_customer.id}
{_customer.id}
For these bot actions, you must enclose the variable name in curly braces {}
:
Bot Message
Carousel
Create Case
Email
Hyperlink
Survey
Bot Actions That Do Not Require Delimiters e.g.{_customer.id}
{_customer.id}
For these bot actions, variables are inserted directly into the input fields. These input boxes are identified by the </> ProtoScript
label at the bottom:
Branch (e.g. for POST when a JSON input is required)
JSON API
Modify Variable
Available Variables
_user_input
_user_input
Captures and stores the most recent input provided by the user during the chat.
Example:
_lang
_lang
Captures the language detected from the user's input during the session.
Example:
_channel_profile
_channel_profile
Stores the profile information of the user based on the communication channel. For Webchat, additional information such as IP address, and location is captured.
Example:
_customer
_customer
Captures the customer profile, including any custom fields populated by the pre-chat form on Webchat apps.
Example:
_channel
_channel
Contains information about the communication channel where the chat occurs.
Example:
_new_ticket
_new_ticket
Provides details of a newly created ticket, including its ID and key attributes.
Example:
_track.fetch_ticket_by_ticket_id("ticket_id_here")
_track.fetch_ticket_by_ticket_id("ticket_id_here")
Fetches details of a specific ticket using its Ticket ID.
Example:
_track.fetch_tickets_by_email("customer_email_here")
_track.fetch_tickets_by_email("customer_email_here")
Fetches all tickets associated with a customer's email address.
Example:
Notes on Usage:
Delimiters: Use
{}
delimiters only when required. For ProtoScript-enabled fields (</> ProtoScript
), input variables directly without delimiters.Pre-Chat Form: Custom fields collected through the pre-chat form automatically populate into the
_customer
variable undercustom_fields
.Dynamic Data: Variables like
_user_input
update dynamically as the user provides new inputs.
Last updated