Skip to main content

Variables

Variable blocks let you create computed or combined values for use in subsequent blocks. They're useful for building formatted strings, calculations, or transforming data. Open any automation in Automation from the top navigation and click Add Condition, Record or Action to add a variable block.

Creating a variable block

  1. Click Add Condition, Record or Action below any block.
  2. Select Variable.
  3. Add one or more variables in the configuration panel.

Variable configuration

Each variable has:

FieldRequiredDescription
NameYesHow to reference this variable (for example, fullName, totalPrice)
TypeYesData type: Text, Number, Boolean, DateTime, Object
Is ArrayNoTurn on if the variable holds multiple values
Object TypeRequired for Object typeUser, Product, Order, or Custom
DateTime VariationRequired for DateTime typeCurrent time, add/subtract time, start/end periods
Default ValueNoThe value or expression for this variable

Variable types

TypeUse forAdditional fieldsExample
TextStrings, messages, formatted contentNoneWelcome, {{user.name}}!
NumberCalculations, countsNone{{order.quantity}} * {{order.price}}
BooleanTrue/false flagsNone{{user.isActive}}
DateTimeDate and time valuesDateTime Variation + optional ValueCurrent date, future dates, date calculations
ObjectComplex data structuresObject TypeUser objects, custom data structures

DateTime variables

DateTime variables support various time calculations:

VariationDescriptionAdditional field
Current Date/TimeCurrent timestampNone
Add/Subtract Days/Hours/MinutesTime arithmeticValue (number)
Start/End of Day/MonthPeriod boundariesNone

Examples:

Variable: tomorrow (DateTime)
Type: DateTime, Variation: Add Days, Value: 1

Variable: monthStart (DateTime)
Type: DateTime, Variation: Start of Month

Variable: deadline (DateTime)
Type: DateTime, Variation: Add Hours, Value: 24

Object variables

Object variables can hold structured data:

Object typeUse for
UserUser profile data
ProductProduct information
OrderOrder/transaction data
CustomAny custom object structure

Example:

Variable: selectedUser (Object)
Type: Object, Object Type: User
Default Value: {{trigger.user}}

Using variables in expressions

The Default Value field supports variable interpolation. Click the + icon next to the input field to select available fields and variables.

Variable: welcomeMessage (Text)
Value: Hello {{user.firstName}} {{user.lastName}}, welcome to our platform!

Reference data from:

  • Trigger: {{triggerAlias.fieldName}}
  • Records: {{recordAlias.fieldName}}
  • Other variables: {{variableName}}

Multiple variables

Add multiple variables in a single block to organize related computations together:

  1. Click + Add Variable to create additional variables.
  2. Later variables can reference earlier ones in the same block.
  3. Variables are processed in order, so dependencies work correctly.

Example: Order processing variables

Variable Block:
- orderTotal (Number) = {{order.subtotal}} + {{order.tax}}
- discountApplied (Boolean) = {{orderTotal}} > 100
- finalAmount (Number) = {{discountApplied}} ? {{orderTotal}} * 0.9 : {{orderTotal}}
- confirmationMessage (Text) = Order total: ${{finalAmount}}

Using variables in actions

Reference your variables in action configurations:

Variable Block:
- customerName (Text) = {{order.customer.name}}
- orderTotal (Number) = {{order.total}}
- isPriority (Boolean) = {{order.priority}} === 'high'
- deliveryDate (DateTime) = Add Days: 2
- customerData (Object, User) = {{order.customer}}

Email Action:
Subject: Order confirmation for {{customerName}}
Body: Your order total is ${{orderTotal}}.
Priority delivery: {{isPriority}}.
Expected delivery: {{deliveryDate}}

Example: Building a notification message

Trigger: Order completed (alias: order)
├─ Record: Find customer (alias: customer)
├─ Variable Block:
│ - recipientName (Text) = {{customer.firstName}}
│ - orderTotal (Number) = {{order.subtotal}} + {{order.tax}}
│ - deliveryDate (DateTime) = Add Days: 3
│ - customerObj (Object, User) = {{customer}}
│ - orderSummary (Text) = Order #{{order.id}} - ${{orderTotal}}
└─ Action: Send Email
To: {{customer.email}}
Subject: {{orderSummary}}
Body: Hi {{recipientName}}, your order will arrive by {{deliveryDate}}!

Best practices

  • Use descriptive namesformattedAddress is clearer than var1
  • Group related variables — Put calculations, formatting, and logic together in one block
  • Leverage variable types — Use DateTime for date calculations, Object for structured data
  • Order dependencies correctly — Define base variables first, then derived ones
  • Simplify complex actions — Create variables first, then use them in actions