Contact Variables

Contact Variables

@contact – denotes the recipient of the message. This refers to the active contact — the individual whose replies are being processed within the workflow. When employing the Send a Message to Someone Else action, @contact indicates the contact or group of contacts to whom the message is addressed.

Each extension, such as @contact.name or @contact.fields.field_name, corresponds to a particular contact field.

@contact – The contact’s full name, if available; otherwise, their phone number. Example: “Ben Haggerty”

@contact.name – Also the contact’s full name, if provided. Example: “Ben Haggerty”

@contact.first_name – The contact’s first name, if available. Example: “Ben”

@contact.groups – The groups to which the contact belongs.

@contact.uuid – The universally unique identifier assigned to the contact.

@contact.display – The contact’s name or URN.

@contact.language – The ISO language code for the contact.

@contact.created_on – The date the contact was created.

@contact.channel – The contact’s preferred channel.

@contact.fields.field_name – Refers to any custom contact fields you have defined, such as @contact.age.

Contact URNs

To access URNs of specific types for your contacts, use the @urns variable.

@urns – All URNs associated with the contact.

@urns.mailto – The email address assigned to the contact.

@urns.tel – The contact’s phone number.

@urns.channel type – Refers to the specific channel type of the contact, such as @urns.facebook@urns.whatsapp, or @urns.jiochat.

@urns.line – The LINE ID for the contact.

Contact Fields

@fields variables correspond to custom contact fields.

@fields – The custom fields for the contact.

@fields.field_name – A specific custom field created for the contact, e.g., @fields.age or @fields.baby_name.

Flow Result Variables

@run.results, or its abbreviated form 

@results, refer to values captured at each Wait for Response step within a flow. 

@results variables only pertain to values gathered in the current flow run.

This enables you to reference previously collected values or update contact fields using information provided by the contact.

The variable name corresponds to the result name of the Wait for Response action that captured it:

When you enter @results. in a node’s text dialogue, an auto-completion menu will appear listing available variables in the flow.

For example…

A simple flow has been created to collect and update a contact’s name and age using @results.contact_field.

The Wait for Response Split Action named “Name” collects the contact’s name. Note that the response rule has any of the words is used to keep it open-ended.

The contact’s responses can then be referenced using the @results. prefix:

You can use @results.name to save the contact’s name to a new contact field of the same name.

Below is a list of extensions that allow you to filter flow result variables according to your needs. variable_name serves as a placeholder for any result present in a flow:

@results – All flow variables collected up to this point. Example: “Name: Jane, Age: 32”

@results.variable_name.value – The value collected. Example: “32”

@results.variable_name.category – The category to which a response was evaluated. Example: “Valid”

@flow.variable_name.created_on – The date and time when a flow value was collected. Example: “2014-05-02 19:11:50” (dependent on your timezone and date format settings).

Input Variables

The @input variable refers to the most recent input.

@input – The most recent input.

@input.text – The text of the last message. Example: “help”

@input.created_on – The date and time when the last message was received. Example: “11-12-2015 13:24”

@input.type – The type of the last input.

@input.uuid – The UUID of the last input.

@input.channel – The channel type through which the last input was received.

@input.attachments – The attachments from the last message.

@input.external_id – The external ID associated with the input.

Date Variables

Date values are now expressed as function calls, such as @(today()) and @(now()). For more details on functions, refer to the relevant documentation.

Parent & Child Variables

In child flows, accessed via Start Another Flow actions and subflow Split Actions, @parent can be used to reference flow result fields collected in the preceding (parent) flow, e.g., @parent.field.

Similarly, @child can be used in the parent flow to reference flow fields collected by the child flow up until the contact either completed the child flow or exited it.

External Variables

When referencing external variables from a Webhook, such as with Airtable, use the @webhook variable.

Alternatively, when passing an external variable while initiating a flow via Zapier or an external API, use @trigger.params.variable_name.

Additionally, you can use @trigger.user in your flows to view the email address of the user who initiated the flow broadcast, and @trigger.origin to see how and where the flow was started (e.g., UI, API, or Zapier).

Global Variables

Globals are shared values that can be referenced in flowsbroadcasts, and campaigns within your account using @globals.value_name. They allow you to define a value once and reuse it without re-entry.

Learn more about using globals here.

Advanced Usage

As in JavaScript, variables can also be referenced using square bracket notation. Note that this requires parentheses around the entire expression. For example, @contact.name is equivalent to @(contact["name"]).

The property name can itself be a variable. For instance, if the value of Response 1 was “name”, you could write the above example as:

@(contact[results.response_1])

If you have any questions, feel free to send us a message via the support widget in the bottom right corner!