Variables
Proto Variables store information from a chat session, including data about the app, the user, and any inputs during the interaction. These variables can be utilized in the chatbot as follows. To display a variable's value within a bot message, enclose the variable name within curly braces { } as a delimiter.
Requires { … } delimiter
Bot Message
Carousel
Create Case
Email
Hyperlink
Survey
Do not require { … } delimiter
Branch
JSON API
Modify Variable
Variables
_user_input
_user_inputIt captures and stores the user's input at each interaction stage within the bot. It is dynamic, meaning that it updates automatically each time the user enters a new input.
_lang
_langRecords the language identified from the user's input during each interaction.
_channel_profile
_channel_profileThis variable holds profile information for the end user as obtained from the communication app. It includes details such as the user's ID on Proto, their display name, the type of channel they are using, their profile picture URL, and other specific information that varies depending on the app type.
For users connecting through Webchat, this variable also captures additional information if certain features are activated in the Webchat settings, such as:
Data from a pre-chat form
User location and IP address details, among other information.
Example
{
"id": JSHSFHDHBJVKOISFIU,
"display_name": "Weiying",
"location": "MY",
"email": "[email protected]",
"phone_number": "34898483245",
"ip_address": "0.0.0.0",
}_customer
_customerThis variable contains the customer profile information for end users who have created a profile on the Customer page. It includes the user's name, email, phone number, and any custom fields specified in the Customer settings.
Example
{
"id": customer.id,
"external_customer_id": customer.external_customer_id,
"name": customer.name,
"location": customer.location,
"email": customer.email,
"phone_number": customer.phone_number,
"provided_unique_id": customer.provided_unique_id,
"tags": list(set(customer_tags)),
"tag_groups": [tag_group.name for tag_group in customer.tag_groups],
"custom_fields": {
cf.custom_field.name: cf.value
for cf in (customer_custom_fields or [])
}_channel
_channelChannel variables that store information about a channel such as the channel ID, channel type, and other additional details (different on each channel).
Example
{
"id": channel.id,
"type": "webchat",
}_new_ticket
_new_ticketTicket variable that returns ticket info once a new ticket is created.
{
"id": new_ticket_id,
"title": subject,
"customer_id": customer_id,
"assignee_type": assignee.type,
"assignee_id": assignee.id,
"description": description,
"bot_id": bot.id,
"channel_id": channel.id,
"custom_attrs": ["fetched_custom_field.name: cf.value"]
}_track.fetch_ticket_by_ticket_id("ticket_id_here")
_track.fetch_ticket_by_ticket_id("ticket_id_here")Ticket variable that fetches ticket info by ticket ID
{
"id": new_ticket_id,
"status": ticket_status,
"assignee_names": [assignee_names],
"assigned_team_names": [assigned_team_names],
"customer_name": customer_name
}_track.fetch_tickets_by_email("customer_email_here")
_track.fetch_tickets_by_email("customer_email_here")Ticket variable that fetches ticket info by email and returns a list of tickets
[{
"id": new_ticket_id,
"status": ticket_status,
"assignee_names": [assignee_names],
"assigned_team_names": [assigned_team_names],
"customer_name": customer_name
}]Last updated