Using Properties in Flows

Properties are a powerful way to store and use data throughout your flows.

There are three types of properties that can you can use:

  • Session properties - Only stored and usable for the current session. Replies from contacts (i.e. end users) can be stored as session properties.
  • Contact properties - Let's you store data permanently against the contact who is engaging with the flow. Contact properties can be used across sessions (e.g. account number, shoe size or anything else.)
  • Secret properties - For storing sensitive data such as API keys. You'll need the Workspace Owner role to view and edit these properties. They can only be used in HTTP request header fields, currently. We plan to allow them to be used in HTTP request URLs and query parameters in future.

Session properties

These are effectively properties stored on the session object.

Default session properties

There are some default session properties that you can always use in your flow without having to set them

Property Description
{{session.createdAt}} The time that the session was created, in Unix time format
{{session.profile}} The contact's WhatsApp nickname that they have set
{{session.contactIdentifier}} Phone number of the contact who is engaging
{{session.sessionUuid}} Unique ID of the session
{{session.initialMessage.text}} First inbound message text. See Message Response Properties for a full list of message properties you can use with this.

Message response properties

When a person responds to a message you can save their response as a session property that can be used later on throughout the flow. For example, if you ask someone what their email address is and you save that response email you can then use {{session.email.text}} to insert the text from their reply pretty much anywhere you can think of in the flow, such as other messages, if conditions, JSON bodies in HTTP requests, functions or other properties.

Customers can send in different types of message such as text, image, video, audio, file, location and reply.

Depending on the type of inbound message, there are some different properties you can access on it. For example, let's say you save a person's reply as a property called response and allow them to reply with any type of message. These are some of the properties you would be able to access on that property using the following properties.

Property Description
{{session.response.type}} Message type: text, image, video, audio, file, location, or reply
{{session.response.text}} Available on text message types
{{session.response.url}} Available on file, video, image, and audio messages
{{session.response.caption}} Available on file, video, and image messages
{{session.response.filename}} Available on file messages
{{session.response.address}} Available on location messages
{{session.response.name}} Available on location messages
{{session.response.latitude}} Available on location messages
{{session.response.longitude}} Available on location messages
{{session.response.id}} Available on reply messages from button or list outbound
{{session.response.title}} Available on reply messages from button or list outbound
{{session.response.description}} Available on reply messages from list outbound message

Email Channel Properties

When creating flows for Email channels, the following properties are available for conditional branching and use throughout your flow:

Property Description
{{initialMessage.sender.email}} Email address of the person who sent the initial message
{{initialMessage.sender.name}} Display name of the initial sender
{{session.initialMessage.subject}} Subject line of the email
{{session.initialMessage.text}} Plain text content of the email body
{{session.initialMessage.html}} HTML content of the email body
{{session.initialMessage.markdown}} Markdown-formatted content of the email body
{{session.initialMessage.attachments}} Attachments on the initial email
{{session.initialMessage.recipients}} List of recipients (To field)
{{session.initialMessage.ccRecipients}} List of CC recipients

Ticket properties

When a ticket is closed in Live Chat you can use the following properties in a Resolution Flow:

Property Description
{{session.ticket.uuid}} UUID of the ticket
{{session.ticket.subject}} Ticket subject
{{session.ticket.priority}} Ticket priority
{{session.ticket.status}} Ticket status
{{session.ticket.createdAt}} Ticket open timestamp
{{session.ticket.closedAt}} Ticket close timestamp
{{session.ticket.assignees}} An array of user objects assigned to the ticket, for example: [{"email":"", "firstname":"", "lastname":""},...]
{{session.ticket.team}} Emoji + team name as a string, or "unassigned"
{{session.ticket.team.uuid}} Team UUID, or empty string "" if not assigned to a team
{{session.ticket.team.name}} Team name, or "unassigned" if not assigned to a team
{{session.ticket.team.emoji}} Team emoji, or empty string "" if not assigned to a team

Custom session properties

You can also set custom session properties using a 'Set' step. This is useful for if you want to set commonly used properties such as a base URL for an API or if you want to save some data from an API response into a property.

Below is an example of how you can set a BASE_URL property in your flow...

...that you can then use in the URL field of an HTTP request which has it's response saved in {{session.customer}}.

The full URL in the screenshot below is {{session.BASE_URL}}/customer/{{session.contactIdentifier}} and will be rendered as https://api.example.com/customer/27727134468 assuming the person who is sending the message has the phone number 27727134468 (note that international country code prefixes are used.)

If your API then responds with some JSON like this:

{
  "firstName": "Alex",
  "lastName": "Smith",
  "birthday": "1989-08-27"
}

you can then use another Set step to select specific data from the JSON response using a JSONPath query on {{session.customer.body}} and save it to a session property.

which you can then use throughout the rest of your flow as {{session.birthday}}.

Contact properties

You can also use the Set step to save a property to a contact's profile which can then be used across sessions and also seen on the customer's profile in the right side bar of Live Chat.

Secret properties

You can use secrets to store sensitive properties such as API keys that can be used in the headers of HTTP requests. You will need a Workspace Owner role to access and edit secrets.

0:00
/

Once you've saved a secret you can insert it into your HTTP requests like this: