Variables
Many inputs such as the Say/Play message and Send Analytics Event accept variables which will be substituted when possible. Variables are always wrapped in --
. For example, you could set the Say/Play message to be:
These variables will be substituted and the become something like:
Missing variables
Not all variables are always present. For example, if the caller calls from a mobile phone we won't know the --call.FromCity--
, in this case, the variable will be replaced will be ignored.
Supported Variables
The available variables change depending on your flow type and trigger.
All Flows:
All flows will have contact variables available for use. These are particularly useful for sending personalised greetings, SMS and emails. Note that these variables will not always be present. We recommend you sync your users/CRM data into our contact system so you'll always have access to this data.
Name | Always Present? | Description |
contact.id | Yes | Pickle Contact ID |
contact.userId | No | User ID in your CRM or database |
contact.firstName | No | First Name |
contact.lastName | No | Last Name |
contact.company | No | Company Name |
contact.email | No | Email address |
contact.phoneNumber | No | Primary phone number |
contact.phoneNumbers | No | Array of other phone numbers. |
contact.customFields | No | Custom fields, eg) |
contact.tags | No | Array of tags, eg) |
Incoming Call Flows:
If you have a Call flow triggered with an 'Incoming Call' trigger:
Name | Always present? | Description |
call.CallSid | All incoming calls | Unique id for the call. |
call.From | All incoming calls | From phone number. eg: +61499998888 |
call.To | All incoming calls | To phone number |
call.CallStatus | All incoming calls | queued | ringing | in-progress | completed | busy | failed | no-answer |
call.ForwardedFrom | No | Phone number that forwarded this call |
call.FromCity | No | The city of the caller |
call.FromState | No | The state or province of the caller |
call.FromZip | No | The postal code of the caller |
call.FromCountry | No | The country of the caller |
call.ToCity | No | The city of the called party |
call.ToState | No | The state or province of the called party |
call.ToZip | No | The postal code of the caller |
call.ToCountry | No | The country of the called party |
Incoming SMS Flows:
If you have an SMS flow triggered with an 'lncoming SMS' trigger:
Name | Always present? | Description |
message.MessageSid | All incoming SMS | Unique id for the message. |
message.From | All incoming SMS | From phone number. eg: +61499998888 |
message.To | All incoming SMS | To phone number |
message.Body | All incoming SMS | The text body of the message. Up to 1600 characters long. |
message.NumMedia | All incoming SMS | Number of MMS attachments |
message.FromCity | No | The city of the sender |
message.FromState | No | The state or province of the sender |
message.FromZip | No | The postal code of the sender |
message.FromCountry | No | The country of the sender |
Inspecting real variables using Flow Logs
After your flow has run once, you'll be able to view the flow log from the flow log section. This will show exactly what the values were for the variables described above. For example:
The variable name shown in Flow Logs have been transformed to make them more readable. For example, numMedia
becomes Num Media
. You'll need to use the camel-case version - numMedia
.
Last updated