Variables in Velaro
Variables in Velaro
What are variables?
Variables are dynamic placeholders that resolve to real data at runtime. Use them to personalize messages, make routing decisions, pass data between workflow steps, and connect conversation data to your CRM.
Variables look like: <<variableName>>
Variable scopes
Variables have three scopes that determine where they are available:
Contact variables — tied to the contact record. Persist permanently. Available in every conversation with that contact forever.
Examples: <<firstName>>, <<email>>, <<accountId>>, <<plan>>
Conversation variables — tied to one conversation. Set during the chat, cleared when resolved. Use for in-conversation state like survey answers or order numbers.
Examples: <<issueType>>, <<orderNumber>>, <<preferredAgent>>
Workflow variables — temporary within a single workflow run. Cleared when the workflow ends. Use for intermediate calculation results.
Examples: <<lookupResult>>, <<tempScore>>, <<apiResponse>>
Built-in variables
These are always available without any setup:
| Variable | Value |
|---|---|
| <<firstName>> | Contact's first name |
| <<lastName>> | Contact's last name |
| <<email>> | Contact's email address |
| <<phone>> | Contact's phone number |
| <<channel>> | Current channel: web, sms, whatsapp, facebook, etc. |
| <<conversationId>> | Unique ID of the current conversation |
| <<timestamp>> | Current date and time |
| <<agentName>> | Name of the assigned agent (if any) |
| <<teamName>> | Name of the assigned team |
Custom contact fields as variables
Any custom field you create in Contact Center > Custom Fields is automatically available as a variable. The variable name matches the field name you set.
If you create a field named accountTier, use it as <<accountTier>>.
Setting variables in workflows
Ask Question node: the visitor's answer is saved as a variable. Set the variable name in the node's "Save answer as" field.
Set Data node: explicitly set any variable to any value. Use this to:
- Copy a value from one variable to another
- Set a default value
- Concatenate values:
<<firstName>> <<lastName>> - Mark contact status: set
<<vipCustomer>>totrueafter verifying account tier
HTTP Request node: response fields from an API call can be mapped to variables. For example, call your orders API and map response.status to <<orderStatus>>.
Using variables in messages
Insert a variable anywhere in a message by typing <<variableName>>:
Hi <<firstName>>, thanks for reaching out about order <<orderNumber>>.
I can see your <<plan>> plan details right here.
At runtime, variables are replaced with actual values. If the variable is empty, the placeholder is removed.
Fallback values
Prevent blank gaps in messages by setting a fallback:
<<firstName | there>> → "Hi there," when firstName is not set
<<plan | your current plan>> → uses fallback if plan is empty
Syntax: <<variableName | fallback text>>
Variables in routing conditions
Use variables in Rules and Condition workflow nodes to make decisions:
- Route conversations where
<<plan>>equals "Enterprise" to the enterprise support team - Show different chat windows based on
<<language>> - Skip the survey if
<<email>>is already filled in - Escalate immediately if
<<vipCustomer>>equalstrue
Passing variables from your website
Use the embed script pre-load block to pass known data from your site to Velaro before the conversation starts:
<script>
window.VelaroSettings = {
contact: {
name: "Jane Smith",
email: "jane@company.com",
customFields: {
accountId: "ACC-9821",
plan: "Enterprise",
vipCustomer: true
}
}
};
</script>
These values are immediately available as variables in all workflows and AI bots for that conversation.
Survey fields as variables
Pre-chat and post-chat survey answers are automatically stored as contact variables. If your survey has a field named "topic", the answer is available as <<topic>> in any workflow triggered after the survey completes.
Use survey answers in rules: route visitors who select "Billing" to the billing team, "Technical" to technical support, etc.
Troubleshooting variables
Variable showing as blank in messages: the variable was never set. Check the Execution Log in the workflow editor — it shows the value of every variable at every step.
Routing condition not matching: variables are case-sensitive. <<plan>> equals "Enterprise" will not match "enterprise" — use consistent casing when setting and reading variables.
Variable set in workflow but not saved to contact: use a "Set Data" node with scope set to "Contact" (not Workflow) to persist values permanently.
Was this article helpful?