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

It 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 new input.

_lang

Records the language identified from the user's input during each interaction.

_channel_profile

This 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": "weiying@proto.cx",
	"phone_number": "34898483245",
	"ip_address": "0.0.0.0",
}

_customer

This 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 [])
	}

Last updated