@contact references the contact receiving the message. In most cases, this is the active contact - the person whose responses are being handled by the workflow. When using the Send a Message to Someone Else action,@contact refers to the contact or group of contacts to which the message is being sent. Each extension, e.g. @contact.name or @contact.tel, references a specific contact field.
@contact - The full name of the contact if one is set, otherwise their number, e.g. "Ben Haggerty"
@contact.name - Also the full name of the contact if one is set, otherwise their number, e.g. "Ben Haggerty"
@contact.first_name - The first name of the contact if one is set, otherwise their number, e.g. "Ben"
@contact.mail_to - The email address assigned to the contact
@contact.tel - The phone number of the contact in human readable format, e.g. "(206) 555 1212"
@contact.tel_e164 - The phone number of the contact in E164 format, e.g. "+12065551212"
@contact.groups - The groups in which the contact has been placed.
@contact.uuid - The universally unique identifier assigned to each contact.
@contact.[contact-field] - any contact fields you've created for your contacts, e.g. "@contact.age"
@flow variables refer to values collected at each RuleSet within a flow. @flow variables only reference values collected by the flow in which they're called. This allows you to refer to previously collected values or update contact fields with a value sent by a contact.
The name of the variable will correspond with the name of the result of the RuleSet that collects it:
When you type @flow into a step, an auto-completion drop-down menu will appear listing the current flow variables in the flow:
We've created a flow that allows health professionals to record the name, village and date of last missed period (LMP) from expecting mothers:
The Wait for Village RuleSet collects responses to the "Which village does @flow.name live in?" Send Message step using an open-ended response rule and saves the resulting values to a flow field titled "Village":
Your contacts' responses can then be referenced using the @flow. prefix:
We can then use @flow.village to save a contact's village to a new contact field of the same name:
Here's a list of extensions that give you the power to filter flow variables depending on your needs ([variable-name] is a placeholder for any result present in a flow):
@flow - All flow variables collected to this point, e.g. "Name: Jane, Age: 32"
@flow.[variable-name] - The value collected, e.g. "32"
@flow.[variable-name].category - The category a response is evaluated to, e.g. "Valid" (above ^)
@flow.[variable-name].text - The raw text evaluated within a RuleSet, e.g. "My age is 32"
@flow.[variable-name].time - The date and time when a flow value was collected, e.g. "2014-05-02 19:11:50" (dependent on your timezone and date format settings).
The @step variable references the contact who sent the last message handled by the workflow. In most cases, this is also the active contact. When using the Send an SMS Response action, @step.contact and @contact are the same contact. When using the Send a Message to Someone Else action, @step.contact refers to the contact who has reached the Send a Message to Someone Else action within the flow, thus triggering it to send.
@step - The value of the step, usually the content of the last message, e.g. "help"
@step.value - Also the value of the step, usually the content of the last message, e.g. "help"
@step.date - The date and time when the last message was received, e.g. "11-12-2015 13:24"
@step.contact - The contact (and all associated variables) active in the flow.
@step.contact.[contact-field] - The value of a contact field associated with the contact active in the flow.
@channel variables refer to the channel through which a message is received. For example, if a contact sends a message to an Android channel connected to your account, the @channel variable will refer to number assigned to that phone's SIM card.
@channel - the phone number that received the last message from a contact, in a human readable format, e.g. "(206) 555 1212"
@channel.name - the name of the channel (this can be edited by clicking a channel)
ex: "Nexus 5"
@channel.tel - the phone number that received the last message from a contact, in a human readable format, e.g. "(206) 555 1212"
@channel.tel_e164 - the E164 format of the phone number that received the last message from a contact, e.g. "+12065551212"
@date variables refer to time values in the timezone you've assigned to your account. Note that the format of @date variables are dependent on your date format settings.
@date - The current date and time, e.g. "02-05-2014 20:08"
@date.now - The current date and time, e.g. "02-05-2014 20:08"
@date.today - The current date, e.g. "02-05-2014"
@date.tomorrow - The date tomorrow, e.g. "03-05-2015"
@date.yesterday - The date yesterday, e.g. "01-05-2014"
Parent, Child Variables
In child flows, entered through Start Another Flow actions and Subflow RuleSets, @parent can be used to reference the flow fields collected in the previous (parent) flow, e.g. @parent.[field].
Likewise, @child can be placed in the parent flow to reference flow fields collected by the child flow up to the point the contact either finished the child flow or expired from it.
@extra references variables returned from an external application via a WebHook.