Proto AICX Docs
  • Getting Started
    • Glossary
    • Signing-in
    • Main Dashboard
    • Platform Bot
    • Data Privacy
  • AICX Modules
    • AI Assistants
      • Manage Assistants
      • Actions
        • Send Message
        • Send File
        • Show Carousel
        • Show Survey
        • Collect Feedback
        • Create Ticket
        • Human Handoff
        • External Handoff
        • Jump to Trigger/Action
        • If/Else
        • Set Chat Variable
        • Send API Request
      • LLMs
        • Cloudflare Training
      • Publishing
        • Webchat
          • Proactive Messages
        • Facebook Messenger
        • WhatsApp
        • Telegram
        • LINE
        • Africa's Talking
        • Bitrix24
        • Zendesk
    • Inbox
      • Find & View Conversations
      • Message Editor
      • Transfers & Takeovers
    • Livechats
    • Tickets
    • People
    • Analytics
      • Winnow
  • General
    • Settings
      • Company
        • Plan & Billing
          • Interactions Amount
        • Roles & Permissions
        • Users
        • Teams
        • IP Allowlist
        • Whitelabelling
      • Sub-Company
        • Banning
        • Tags
        • Chat Assignment
        • Email Domains
        • Email Templates
        • Exports
        • Canned Replies
        • Custom Fields
        • Custom Profiles
        • Custom Analytics
      • User Account
        • User Aliases
        • Online Status
    • Plans & Pricing
    • Enterprise Max
  • Developers
    • Developer Tools
      • Chat Variables
      • Chat Scripts
      • Webchat Script
      • Developer API
      • On-Premise & Hybrid Hosting
Powered by GitBook
On this page
  • Definition
  • Actions & Delimiters
  • System Variables
  • _user_input
  • _lang
  • _channel_profile
  • _customer
  • _channel
  • _new_ticket
  • _track.fetch_ticket_by_ticket_id("ticket_id_here")
  • _track.fetch_tickets_by_email("customer_email_here")
  1. Developers
  2. Developer Tools

Chat Variables

Leverage dynamic data during live messaging.

PreviousDeveloper ToolsNextChat Scripts

Last updated 2 months ago

Definition

Chat variables store information from a chat session, including data about the app, user, and any inputs during the interaction. These variables can be utilised in an AI assistant's subsequent actions.


Actions & Delimiters

The following actions support chat variables. To display a variable's value within an AI assistant's action content, enclose the variable name within curly braces { } as a delimiter.

Actions that require { ... } delimiter
Actions that do not require delimiter

System Variables

The action can create new variables or reference existing system variables:

_user_input

Captures and stores the person's input at each interaction stage within the AI assistant. It is dynamic, meaning that it updates automatically each time the person enters a new input.


_lang

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


_channel_profile

Holds profile information for the person as obtained from the messaging app. It includes details such as the person's ID in Proto, their display name, the type of channel they're using, their profile picture URL, and other information that varies depending on the app.

For people 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

  • Person's location and IP address

Example
{
	"id": JSHSFHDHBJVKOISFIU,
	"display_name": "Weiying",
	"location": "MY",
	"email": "weiying@proto.cx",
	"phone_number": "34898483245",
	"ip_address": "0.0.0.0",
}

_customer

Note that "customer" is a legacy term for an audience member, now referred to more generically as "people" or "persons" in the current platform and documentation.

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

Example
{
	"id": channel.id,
	"type": "webchat",
}

_new_ticket

Example
{
    "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")

Ticket variable that fetches ticket info by ticket ID.

Example
{
    "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")

Ticket variable that returns a list of tickets and their info by user email.

Example
[
    {
        "id": new_ticket_id, 
        "status": ticket_status, 
        "assignee_names": [assignee_names], 
        "assigned_team_names": [assigned_team_names],
        "customer_name": customer_name
    }
    ...
]

Contains profile information for persons who have a profile in Proto AICX. This includes their name, email, phone number, and any .

Channel variables store information about a such as the channel ID, channel type, and other details unique to each channel.

Contains ticket info when a new is created.

Set Chat Variable
People
custom fields
channel
email ticket
Send Message
If/Else
Send File
Set Chat Variable
Show Carousel
Send API Request
Show Survey
Create Ticket