Expressions in On-chat.live: Dynamic Message Personalization Guide

Root Context

These are the top-level variables accessible in the On-Chat context:

  • contact : The contact details of the user.
  • fields : Custom field values associated with the contact.
  • urns : The URN values of the contact.
  • results : Current run results.
  • input : The current input from the contact.
  • run : The current run session.
  • child : The last child run in the current session.
  • parent : The parent run session of the current context.
  • ticket : The last opened support ticket for the contact.
  • webhook : The parsed JSON response from the last webhook call.
  • node : The current node in the flow.
  • globals : The global values available across sessions.
  • trigger : The trigger event that started the current session.
  • resume : The resume that continued the current session.

Types in Context

Here are the types found in the On-Chat context:

Channel

Defaults to the name (text)

  • UUID : the UUID of the channel (text)
  • Name : the name of the channel (text)
  • Address : the address of the channel (text)

Contact

Defaults to the name or URN (text)

  • UUID : the UUID of the contact (text)
  • ID : the numeric ID of the contact (text)
  • First Name : the first name of the contact (text)
  • Name : the name of the contact (text)
  • Language : the language of the contact as 3-letter ISO code (text)
  • Created On : the creation date of the contact (datetime)
  • Last Seen On : the last seen date of the contact (any)
  • URNs : the URNs belonging to the contact (text)
  • Preferred URN : the preferred URN of the contact (text)
  • Groups : the groups the contact belongs to (group)
  • Fields : the custom field values of the contact (fields)
  • Channel : the preferred channel of the contact (channel)
  • Tickets : the open tickets of the contact (ticket)

Flow

Defaults to the name (text)

  • UUID : the UUID of the flow (text)
  • Name : the name of the flow (text)
  • Revision : the revision number of the flow (text)

Group

  • UUID : the UUID of the group (text)
  • Name : the name of the group (text)

Input

Defaults to the text and attachments (text)

  • UUID : the UUID of the input (text)
  • Created On : the creation date of the input (datetime)
  • Channel : the channel that the input was received on (channel)
  • URN : the contact URN that the input was received on (text)
  • Text : the text part of the input (text)
  • Attachments : any attachments on the input (text)
  • External ID : the external ID of the input (text)

Node

  • UUID : the UUID of the node (text)
  • Visit Count : the count of visits to the node in this run (number)

Result

Defaults to the value (text)

  • Name : the name of the result (text)
  • Value : the value of the result (text)
  • Category : the category of the result (text)
  • Category Localized : the localized category of the result (text)
  • Input : the input of the result (text)
  • Extra : the extra data of the result, such as a webhook response (any)
  • Node UUID : the UUID of the node in the flow that generated the result (text)
  • Created On : the creation date of the result (datetime)

Resume

  • Type : the type of resume that resumed this session (text)

Run

Defaults to the contact name and flow UUID (text)

  • UUID : the UUID of the run (text)
  • Contact : the contact of the run (contact)
  • Flow : the flow of the run (flow)
  • Status : the current status of the run (text)
  • Results : the results saved by the run (results)
  • Created On : the creation date of the run (datetime)
  • Exited On : the exit date of the run (datetime)

Ticket

  • UUID : the UUID of the ticket (text)
  • Subject : the subject of the ticket (text)
  • Body : the body of the ticket (text)

Topic

Defaults to the name (text)

  • UUID : the UUID of the topic (text)
  • Name : the name of the topic (text)
  • Description : the description of the topic (text)
  • State : the state of the topic (state)

Trigger

Defaults to the keyword (text)

  • Type : the type of the trigger (text)
  • Keyword : the keyword of the trigger (text)
  • Parameters : the parameters of the trigger (any)
  • Created By : the user who created the trigger (user)