Template Variables

Personalize messages and notifications with dynamic variables like member names and form data.

Advanced
2 min read

Template Variables

Personalize messages, notifications, and other content with dynamic variables.

Basic Syntax

Use double curly braces: {{variable.property}}

Hello {{member.first_name}}, welcome! I'm {{assistant.name}}.

Available Variables

Member

VariableExample
{{member.first_name}}"Jane"
{{member.name}}"Jane Smith"
{{member.email}}"jane@example.com"
{{member.phone}}"+1 555 123-4567"

Member Form Data

Access data type fields by slug and field name:

{{member.data.contact_info.emergency_contact}}
{{member.data.profile.company_name}}

Member Collections

Access collection data types with count, latest record, and recent records:

{{member.collections.patient_visits.count}}
{{member.collections.patient_visits.latest.data.diagnosis}}
{{member.collections.patient_visits.latest.created_at}}
{{member.collections.lab_results.latest.data.result}}

Loop through recent records:

{% for visit in member.collections.patient_visits.recent %}
  - {{visit.data.diagnosis}} ({{visit.created_at}})
{% endfor %}

Tip: {{member.data.<collection>.<field>}} also works for collections but returns a non-deterministic record when multiple exist. Use member.collections for reliable, structured access.

Assistant (Agent in the assistant role)

The assistant variable refers to the AI agent assigned to the current workflow or task — the agent acting in the assistant role for this conversation.

VariableExample
{{assistant.name}}"Support Bot"
{{assistant.first_name}}"Support"

Task

VariableExample
{{task.name}}"Customer Onboarding"
{{task.description}}"Complete setup"

Chat

VariableExample
{{chat.id}}"cht_987654321"

Record (in data record events)

VariableExample
{{record.id}}"12345"
{{record.data.field_slug}}Field value
{{record.owner.name}}"Jane Smith"

Examples

Simple greeting

Hi {{member.first_name}}, thanks for reaching out!

With form data

Your order for {{member.data.order.product_name}} is confirmed.
Shipping to: {{member.data.shipping.address}}

Conditional content

{% if member.data.profile.company %}
Company: {{member.data.profile.company}}
{% endif %}

Tips

  • Test first - Preview templates before using in production
  • Handle missing data - Use {% if %} for optional fields
  • Use snake_case - All variable names use snake_case format
  • Actions — Use template variables in automated notifications
  • CEL Expressions — Write dynamic conditions using similar variables
  • Forms — Define the data types that template variables access