{}
button to insert data from previous actions into your workflow.
Common uses:
- Insert search results into AI prompts
- Use deal amount in update actions
- Reference contact email in conditions
- Access nested properties like
contact.properties.firstname
- Build text with multiple variables
What This Does (The Simple Version)
Think of variables like passing notes between actions. One action finds data (like a contact record) and saves it with a name. Later actions can reference that name to use the data. Real-world example: A search action finds deals and saves them astarget_deals
. A loop action references target_deals
to process each one. Inside the loop, you reference current_deal.properties.amount
to get each deal’s amount.
The {}
Button
The easiest way to insert variables:
- Hover over any input field
{}
button appears on the right- Click it to open variable picker
- Select the variable you want
- Variable is inserted in correct syntax
- All action input fields
- Condition fields
- Update value fields
- Prompt fields
- Email body fields
Variable Syntax
Basic Variable
Format: {{variable_name}} Example:Accessing Properties
Format: {{variable.properties.property_name}} Example:Accessing Nested Data
Format: {{variable.path.to.data}} Example:Accessing Array Items
Format: {{variable[0]}} (first item) Example:Common Patterns
From Search Action
After Search HubSpot (V2): Output variable:target_deals
Access in later actions:
- Whole list: {{target_deals}}
- First deal: {{target_deals[0]}}
- First deal’s name: {{target_deals[0].properties.dealname}}
From Lookup Action
After Lookup HubSpot Object (V2): Output variable:contact_record
Access properties:
- Email: {{contact_record.properties.email}}
- First name: {{contact_record.properties.firstname}}
- Company: {{contact_record.properties.company}}
- Object ID: {{contact_record.id}} or {{contact_record.hs_object_id}}
From Loop
Inside For Loop: Current item variable:current_deal
Access current item:
- Whole object: {{current_deal}}
- Deal name: {{current_deal.properties.dealname}}
- Deal amount: {{current_deal.properties.amount}}
- Object ID: {{current_deal.hs_object_id}}
From Webhook
After webhook trigger: Webhook variables available immediately:- {{contact_id}}
- {{deal_name}}
- {{_hubspot_portal}}
- Whatever you included in HubSpot webhook payload
From Set Variable
After Set Variable action: Variable name:total_count
Access anywhere after:
- {{total_count}}
- Conditions: {{total_count}} > 10
- Updates: Set property to {{total_count}}
- Math: {{total_count}} + 1
Using Variables in Different Actions
In Update Actions
Update HubSpot Object (V2):- Select property to update
- In value field, hover and click
{}
- Select variable
- Or mix text + variables: “Total: ${{deal_amount}}”
- Update
hs_lead_status
with: {{enrichment_result}} - Update
notes
with: “Score: {{lead_score}} - Company: {{company_name}}“
In Conditions
If Condition:- Type condition naturally
- Click
{}
to insert variables - AI evaluates the condition
In AI Prompts
Invoke LLM:- Type prompt text
- Click
{}
to insert variables - AI receives the data
In Loops
For Loop:- “Loop through” field: Click
{}
→ select list variable - “Current item” field: Type name like
current_contact
- {{current_contact.properties.email}}
- {{current_contact.properties.firstname}}
In Search Filters
Search HubSpot (V2):- Add filter
- In value field: Click
{}
- Insert variable for dynamic search
- Find deals where
amount
Greater Than {{minimum_threshold}} - Find contacts where
company
Equals {{target_company}}
Real Examples
Deal Analysis with Variables
Step 1: Lookup Deal- Output Variable:
deal_data
- Object ID: {{deal_data.id}}
- Output Variable:
deal_timeline
- Prompt: “Analyze deal {{deal_data.properties.dealname}} with timeline {{deal_timeline}}”
- Output Variable:
insights
- Update
deal_health_score
with: {{insights.health_score}}
Contact Enrichment with Variables
Step 1: Webhook receives- Variables:
contact_id
,contact_email
,contact_company
- Object ID:
\{\{contact\_id\}\}
- Output Variable:
contact_data
- Query: “{{contact_data.properties.company}} {{contact_data.properties.jobtitle}}”
- Output Variable:
web_results
- Prompt: “Enrich {{contact_data.properties.firstname}} from {{web_results}}”
- Output Variable:
enrichment
- Update
hs_lead_status
with:\{\{enrichment.lead\_category\}\}
Loop with Counter
Step 1: Set Variable- Variable Name:
high_value_count
- Value:
0
- Loop through: {{all_deals}}
- Current item:
current_deal
- Condition: {{current_deal.properties.amount}} > 100000
- Variable Name:
high_value_count
- Value: {{high_value_count}} + 1
\{\{high\_value\_count\}\}
Accessing Associations
After Lookup with Associations: Output variable:deal_data
(with contacts and companies retrieved)
Access associated contact ID:
- Object Type: Contacts
- Object ID:
\{\{deal\_data.associations.contacts[0].id\}\}
Troubleshooting
Variable Not Found
Can’t select variable in{}
picker
Possible causes:
- Variable not created yet (action hasn’t run)
- Variable only exists inside loop/if block
- Action that creates it failed
- Check action order - variable must be created before use
- Create variable outside loop if needed after loop
- Check execution log - did creating action succeed?
Empty Value
Variable exists but has no value Possible causes:- Previous action returned empty result
- Property doesn’t exist on object
- Search/lookup found nothing
- Check execution log - what did previous action return?
- Verify property name is correct
- Add If Condition to check if variable is empty first
Wrong Syntax
Variable doesn’t insert correctly Common mistakes:- ❌
{variable}
(single braces) - ❌
\{\{variable.property\_name\}\}
(should beproperties.property_name
) - ❌
\{\{variable.0\}\}
(should bevariable[0]
)
- ✅ {{variable}}
- ✅ {{variable.properties.property_name}}
- ✅ {{variable[0]}}
Can’t Access Nested Property
Error accessingcontact.properties.email
Possible causes:
- Using
.email
instead of.properties.email
- Property doesn’t exist on this object type
- Property name wrong
- HubSpot properties are always under
.properties.
- Check property exists: Look at object in execution log
- Use exact internal property name (lowercase, no spaces)
Tips & Best Practices
✅ Do:- Use
{}
button instead of typing manually - Use descriptive variable names (
contact_data
notc
) - Check execution log to see variable values
- Test with If Condition to check if variable exists
- Use variables to make workflows dynamic
- Access properties through
.properties.
for HubSpot objects
- Type
{{}}
manually (typo-prone) - Assume variables always have values
- Use variables before they’re created
- Reference loop variables outside the loop
- Forget
.properties.
when accessing HubSpot properties
- Contact email:
.properties.email
- Contact name:
.properties.firstname
and.properties.lastname
- Deal amount:
.properties.amount
- Deal stage:
.properties.dealstage
- Company domain:
.properties.domain
- Object ID:
.id
or.hs_object_id
Related Actions
Foundation:- Variable System - How variables work
- Action Execution - Variable scope and lifecycle
- Search HubSpot (V2) - Creates list of results
- Lookup HubSpot Object (V2) - Creates object variable
- Set Variable - Creates custom variables
- For Loop - Creates current item variable
- Update HubSpot Object (V2) - Insert in update values
- If Condition - Use in conditions
- Invoke LLM - Insert in prompts
Last Updated: 2025-10-01