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.
👋
Note
We are working on an improved UI that will allow you to select properties from a drop down instead of having to use the handlebar syntax in some places, for example: {{session.response.text}}

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

  • {{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 contact who is engaging.
  • {{session.sessionUuid}} - unique ID of the session.
  • {{session.initialMessage.text}} - first inbound message text. See Message response properties below 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.

People on WhatsApp 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.

  • {{session.response.type}}
    could be: 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.respose.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

Ticket properties

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

  • {{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: