Variables are placeholders that let you pull in dynamic information like customer names, order details, or product info directly into your messages and flow logic. Instead of writing generic messages, you can personalize every interaction and build smart automations that respond to real data.
This guide breaks down the different types of variables available in Spur and how to use them.
Types of Variables
Spur organizes variables into five categories:
User Attributes – Always available
Store Attributes – Always available
Workflow Variables – Custom Variable you create for use in a single execution. These are useful for storing temporary data - things that might be different each time a user comes through this automation.
Custom Contact Fields – Fields you create in your database
Last Order Details – Variables to reference the details of the last order (not the current order) they might've placed with their number
Trigger Attributes – Dynamic variables based on the trigger you select
Let's walk through each one.
1. Contact Attributes (User Attributes)
These attributes contain basic information about the person your flow is communicating with.
Available Contact Attributes:
{{contact.firstName}}– The contact's first name{{contact.lastName}}– The contact's last name{{contact.number}}– The contact's phone number{{contact.email}}– The contact's email address
Example:
Message:
Hey {{contact.firstName}}, thanks for reaching out!
How can we help you today?What the customer sees (if their name was Sarah):
Hey Sarah, thanks for reaching out!
How can we help you today?
2. Store Attributes
These contain information about your store and are always available.
Available Store Attributes:
{{store.name}}– Your store name{{store.url}}– Your store URL{{store.contactEmail}}– Your store contact email
Example:
Message:
Visit us at {{store.primaryDomainUrl}} or email us at {{store.contactEmail}} for support.What the customer sees:
Visit us at www.yourstore.com or email us at [email protected] for support.
3. Workflow Variables
Workflow variables are custom variables you create during a flow to store information. You can name them whatever you want.
How to Create a Workflow Variable:
To start with, for example, you can use the "Text With User Input" block to ask the customer a question (e.g., "What's your name?").
In the "Save To" section, check "Show in Flow Data" and give it a name (e.g.,
Customer's name).Save the flow.
Once saved, the variable becomes available throughout the rest of the flow.
You can also designate and save a workflow variable at any point in the flow using an action and selecting ''Save in workflow column'' from the drop down
Example:
Send Message #0 (Wait for User Input type message):
What's your name?
Wait for customer response → Customer replies with ''John'', save response as Customer's name
While building the flow, save the flow at this point and the properties of the workflow variable will become available to reference and select as a variable in the variable picker side menu once you start editing any text field: ''{{properties['NameOfWorkFlowVariableHere']}}''
Send Message #1:
Okay {{properties['Customer's name']}}, how can we help you?What the customer sees:
Okay John, how can we help you?
Important Notes:
Workflow variables only appear after you save the flow.
You can reference them using
{{properties['variable_name']}}.If the customer doesn't provide a response, the variable will be empty, and the message will fail to send.
4. Custom Contact Fields
These are fields you create in the Database section of Spur to store custom information about your contacts.
Examples of Custom Contact Fields:
Party Interested
Birthday Month
Anniversary Month
Customization preferences
VIN (for automotive businesses)
Business Website
Once created, these fields appear in the Custom Contact Fields dropdown when building flows.
How to Use Custom Contact Fields:
You can use them in messages or conditions just like any other variable.
Example:
If you have a custom field called Birthday Month:
You could reference it with: {{contact.custom['Birthday Month']}}
5. Last Order Details
The Last Order Details variables contain the same data as the trigger attributes you'd see when using the Shopify: Order Created trigger.
However, there's an important difference: Last Order Details variables are always available, regardless of which trigger you're using.
When to Use Last Order Details Variables:
Use these variables when you want to reference a customer's previous order information in any flow, not just order-related flows.
Important Warning:
The person going through your flow might not have placed an order yet. If they haven't, these variables will be empty, and any message or condition using them will fail.
Only use Last Order Details variables when you're certain the customer has placed at least one order.
WhatsApp Only:
Last Order Details variables only work in WhatsApp flows because the phone number links a customer's order history to their Shopify account. Spur uses this connection to pull their last order data.
These variables don't work for Instagram or Facebook flows because orders aren't tied to social media accounts.
6. Trigger Attributes
Trigger attributes are the most powerful type of variable. They contain data from the event that triggered the flow (like an order being created, a cart being abandoned, or a comment on Instagram).
How Trigger Attributes Work:
Every trigger in Spur is a pre-configured webhook that receives payload data from Shopify, Meta, or other platforms you have integrated with Spur.
This payload contains detailed information about the event (order details, cart items, customer info, etc.).
Spur makes this data available as trigger attributes so you can reference it anywhere in your flow.
Important Notes:
Trigger attributes only appear after you save the flow.
If you change the trigger, save the flow again to see the new trigger attributes.
Trigger attributes vary depending on which trigger you use.
Example: Order Created Trigger
When you use the Order Created trigger, over 30 trigger attributes become available, including:
{{trigger.name}}– Unique order ID{{trigger.total_price}}– Total price after shipping and taxes{{trigger.financial_status}}– Payment status (paid, pending, etc.){{trigger.computed.shipping_address}}– Full shipping address{{trigger.computed.product_names}}– Names of products in the cart{{trigger.order_status_url}}– Link to the order status page for an order
Example Message:
Thanks for your order, {{contact.firstName}}!
Your order #{{trigger.name}} totaling ₹{{trigger.total_price}} is confirmed.
Track it here: {{trigger.order_status_url}}What the customer sees:
Thanks for your order, Sarah!
Your order #1234 totaling ₹2,500 is confirmed.
Check the status for it here: https://yourstore.com/track/1234
Using Trigger Attributes in Conditions
You can also use trigger attributes to create conditional logic.
Example:
Send a special thank you message only if the order total is above ₹10,000.
Condition:
If {{trigger.total_price}}, Greater than 10000Then Send Message:
Wow, {{contact.firstName}}!
Thank you for your big order of ₹{{trigger.total_price}}.
You're amazing! 🎉How to Access Variables in Your Flow
Variables don't automatically appear in the trigger settings. Here's how to access them:
Add a message or action block in your flow.
Click on any text input field (where you can type a message or enter data).
A dropdown will appear showing all available variables organized by category:
User Attributes
Store Attributes
Workflow Variables
Custom Contact Fields
Last Order Details
Trigger Attributes
Click on any variable to insert it into your message or condition.
Real World Examples
Example 1: Personalized Abandoned Cart Message
Trigger: Abandoned Checkout
Message:
Hey {{contact.firstName}}, you left {{trigger.cart_product_names}} in your cart.
Complete your order now and get 10% off!Example 2: Conditional Discount Based on Order Value
Trigger: Order Created
Condition:
If {{trigger.order_total}} > 5000Then Send Message:
Thanks for your order of ₹{{trigger.order_total}}, {{contact.firstName}}!
Here's a 15% discount code for your next purchase: THANKYOU15Else:
Thanks for your order, {{contact.firstName}}!
We appreciate your support.Example 3: Using Workflow Variables to Collect Feedback
Send Message #0 (Wait for user input type message):
How would you rate your experience with us?
Reply with a number from 1 to 10.
Wait for customer response → Save as rating
Send Message #1:
Thanks for the {{properties['rating']}} rating! We appreciate your feedback.What Happens If a Variable Is Empty?
If a variable has no value (for example, the customer hasn't provided their email), the variable will return nothing, and the message may fail to send or display incorrectly.
To avoid this, you can:
Use conditional logic to check if a variable exists before using it.
Set default values in your flow.
Summary
Variable Type | When Available | Example |
User Attributes | Always |
|
Store Attributes | Always |
|
Workflow Variables | After you save data in the flow |
|
Custom Contact Fields | After you create them in Database |
|
Trigger Attributes | After you select a trigger and save the flow |
|
To see which variables are available for a specific trigger:
Select a trigger in your flow.
Save the flow.
Click on any text input field in a message or action block.
Open the Trigger Attributes dropdown from the menu that opens up on the right to see all available variables.
How to Use Variables in Spur Automation Flows
1. How to Insert a Variable Into a Message
Variables can be inserted into any text field in your flow, whether it's a message, button label, or action field.
Steps:
Add a message block (like "Send Message") to your flow.
Click on the text input field where you want to add a variable.
A dropdown menu will appear showing all available variables organized by category:
User Attributes
Store Attributes
Workflow Variables
Custom Contact Fields
Trigger Attributes
Last Order Details
Click on the variable you want to use, and it will be inserted into your message.
Example:
Message:
Hey {{contact.firstName}}, your order #{{trigger.name}} is on its way!
What the customer sees:
Hey Sarah, your order #1234 is on its way!
Pro Tip:
You can mix multiple variables in a single message. Just click the text field again to add more. Just make sure to not remove the curly braces on both ends. Also ensure that you don't stack 2 variables next to each other. If you are going to do that, at least have a space between the two variables.
2. How to Use Variables in Conditions (If/Then Logic)
Variables aren't just for messages. You can use them to build smart conditional logic that makes decisions based on real data.
Steps:
Add a Condition block to your flow.
In the condition settings, click on the value field where you want to compare data.
Select a variable from the dropdown (like {{trigger.total_price}} or {{contact.tags}}).
Set your comparison operator (is, is not, greater than, less than, equals, contains, is empty, is not empty, has any value, is an email string, is url string, is date etc.).
Add the value you want to compare against.
Example 1: Send a Thank You Message for Large Orders
Condition:
If {{trigger.total_price}} > 10000
Then Send Message:
Wow, {{contact.firstName}}! Thanks for your huge order of ₹{{trigger.order_total}}. You're a legend! 🎉
Else:
Thanks for your order, {{contact.firstName}}! We appreciate your support.
Example 2: Tag-Based Routing
Condition:
If {{contact.tags}} contains "VIP"
Then:
Route to VIP support agent
Else:
Send standard automated response
Example 3: Check Payment Status
Condition:
If {{{trigger.financial_status}} equals "paid"
Then:
Send order confirmation message
Else:
Send payment reminder
3. How to Save a Variable as a Workflow Variable
Workflow variables let you store information collected during a flow so you can reference it later.
Steps:
Add a "Text With User Input" block to ask the customer a question.
In the block settings, find the "Save To" section.
Check the box that says "Show in Flow Data".
Give your variable a name (e.g., Customer's name, Preferred delivery date, Feedback rating).
Save the flow.
Once saved, the variable becomes available throughout the rest of the flow under Workflow Variables.
Example:
Send Message #0:
What's your name?
Wait for customer response → Save as "Customer's name", you can reference it as {{properties['Customer's name']}}
Send Message #1:
Nice to meet you, {{properties['Customer's name']}}!
How can we help you today?
What the customer sees:
Nice to meet you, John! How can we help you today?
You Can Also Save Values Using Actions
You can use the "Save in Flow Column" action to store any value.
Example:
Action: Save in Flow Column
Column: name provided?
Data: yes
Now you can reference {{properties['name provided?]'}} later in the flow at any point.
4. Common Use Cases for Variables
Use Case 1: Personalized Abandoned Cart Recovery
Trigger: Checkout Started
Delay: 30 minutes
Exit condition: Order Placed (this ensures that we are only targeting people who haven't placed an order even after 30 minutes of them starting the checkout.)
Message:
Hey {{contact.firstName}},
You left {{trigger.computed.product_names}} in your cart.
Complete your order and save 10%: {{trigger.abandoned_checkout_url}}
Use Case 2: Dynamic Order Confirmation
Trigger: Order Created
Message:
Thanks for your order, {{contact.firstName}}!
Your order #{{trigger.name}} totaling ₹{{trigger.total_price}} is confirmed.
Track it here: {{trigger.order_status_url}}
Use Case 3: Feedback Collection with Follow-Up
Send Message #0:
How would you rate your experience with us? Reply with a number from 1 to 10.
Wait for response → Save as rating and reference as {{properties['rating']}}
Condition:
If {{properties['rating']}} > 7
Then:
Thanks for the {{properties['rating']}} rating! We're thrilled you loved it. 😊
Else:
Thanks for the {{properties['rating']}} rating.
We'd love to hear how we can improve. Can you share more?
FAQ & Troubleshooting
Q: Why don't I see certain variables?
A: Variables appear based on context. Here's what might be happening:
Trigger Attributes only appear after you save the flow. If you just selected a trigger, save the flow first, then check again.
Workflow Variables only appear after you create and save them. If you haven't set up a "Save To" action yet, they won't show up.
Custom Contact Fields only appear if you've created them in the Database section.
Some variables are channel-specific. For example, Last Order Details variables only work in WhatsApp flows, not Instagram or Facebook.
Q: What happens if a variable has no value?
A: If a variable is empty (for example, the customer hasn't provided their email), the variable will return nothing.
What this means:
In messages, the variable will appear as blank space.
In conditions, the comparison may fail or behave unexpectedly.
The message may fail to send entirely if the variable is required.
How to prevent this:
Use conditional logic to check if a variable exists before using it.
Set default values or fallback messages in your flow.
Example:
Condition:
If {{contact.firstName}} is not empty
Then:
Hey {{contact.firstName}}, thanks for reaching out!
Else:
Hey there, thanks for reaching out!
Alternatively you can also use fallbacks with the variables too. Read more about that here.
Q: Can I create my own custom variables?
A: Yes! You can create custom variables in two ways:
Workflow Variables: Save customer responses or any data during a flow using the "Text With User Input" block or "Save in Flow Column" action.
Custom Contact Fields: Go to the Database section in Spur and create custom fields like "Birthday Month," "VIN," or "Preferred delivery time." Once created, these fields become available as variables in all flows.
Q: Can I use variables in button labels?
A: Yes! You can insert variables into button text, URLs, and any other text field in your flow.
Example:
Button Label: Track Order #{{trigger.name}}
Button URL: {{trigger.order_status_url}}
Q: What's the difference between Trigger Attributes (when Order created trigger is used) and Last Order Details?
A: Both contain order data, but they work differently:
Trigger Attributes with order data to reference are only available when a specific trigger (like "Order Created") fires. They contain data from that specific event.
Last Order Details are always available (in WhatsApp flows only) and contain data from the customer's most recent order, regardless of which trigger you're using.
Warning: Only use Last Order Details variables when you're certain the customer has placed at least one order. Otherwise, the variables will be empty and the flow will fail.
Q: Why can't I use Instagram variables like {{contact.username}} in my flow?
A: Due to Instagram's API limitations, certain user data (like username, follower count, and verification status) can't be fetched until the user has sent at least one message to your account.
Solution: Use these variables only after the user has messaged you, not in automated comment replies or in your first message to them
Best Practices for Using Variables
Always test your flows before going live to make sure variables are pulling the correct data.
Use conditional logic to handle cases where variables might be empty.
Keep variable names simple (especially for workflow variables) to avoid syntax issues.
Don't overload messages with too many variables. Keep it natural and readable.
Use Last Order Details variables carefully. Only use them when you're sure the customer has ordered before.
Need help? Reach out to our support team anytime on WhatsApp :)











