Contact Variables (@contact): Personalize Messages

Contact variables let you personalize messages and make flow decisions using data from the active contact (the person currently moving through the flow). The most common variable family is @contact, which references the active contact’s name, language, groups, fields, and more.

Personalize messages with the active contact

If you just need the essentials, follow this quick path:

  1. Confirm what @contact refers to (the active contact in the run)
  2. Use common @contact properties (name, first_name, language, groups)
  3. Reference custom fields via @contact.fields or @fields
  4. Use @urns to reference addresses (tel, mailto, WhatsApp, etc.)
  5. Store inputs with @results, then reuse them later via @fields
  6. Use @input to reference what they just sent (text/attachments)

Once you treat variables as “reusable data,” your flows become clearer, faster to build, and easier to debug.

Step-by-Step Process

1
Understand what @contact refers to

  • @contact references the active contact receiving the message in the flow.
  • @contact.name is the contact’s full name (if set).
  • If a name is not set, @contact may fall back to a URN (like a phone number), depending on your channel/workspace behavior.
⚠️
Warning: In “Send Message to Third Party,” @contact still refers to the active contact in the run, not the recipient you’re notifying. If you need the recipient’s details, a safer pattern is to start that recipient in a flow, then use a standard Send Message action there.

2
Use common @contact variables for personalization

Here are the most used contact variables:

  • @contact.first_name — friendly greeting (e.g., “Hi Ben”)
  • @contact.groups — which groups the contact belongs to
  • @contact.language — ISO language code (useful for branching)
  • @contact.created_on — when the contact profile was created
  • @contact.uuid — unique identifier (useful for integrations/troubleshooting)

[CAPTURE: A Send Message node showing “Hi @contact.first_name…”]

3
Reference custom contact fields with @contact.fields or @fields

You can store structured data (age, district, clinic, role, etc.) as contact fields.

Use either:

  • @contact.fields.field_name (explicit)
  • @fields.field_name (short form)

Examples:

  • @fields.age
  • @fields.baby_name
💡
Tip: Use consistent field naming (like snake_case) so variables are predictable and easy to reuse across flows.

[CAPTURE: Message editor showing @fields auto-complete list.]

4
Use @urns to message the right destination

URN variables reference a contact’s addresses:

  • @urns.tel — phone number
  • @urns.mailto — email
  • @urns.whatsapp, @urns.facebook, etc. — channel-specific addresses

Use @urns when:

  • You want to include contact address info in internal notifications (e.g., email to staff).
  • You need to route or log based on channel destination.

[CAPTURE: Send Message to Third Party showing @urns.tel and @urns.mailto in the body.]

5
Combine @results + @contact to save data and reuse it later

A common pattern is:

  • Collect user input with Wait for Response → saves as @results.some_value
  • Use Update Contact to store it into a contact field
  • Later, reuse it via @fields.some_value or @contact.fields.some_value

Example:

  • Collect name → @results.name
  • Save to contact field “name” → later greet using @contact.first_name

[CAPTURE: Flow snippet with Wait for Response → Update Contact → Send Message using @contact.first_name.]

6
Use @input for “what they just sent”

Use input variables to reference the most recent inbound message or attachment:

  • @input.text
  • @input.attachments
  • @input.created_on
  • @input.channel

This is useful for:

  • Echoing the user’s last response
  • Parsing structured submissions
  • Handling attachments

[CAPTURE: Example using @input.text in a validation message.]

Common Issues & Quick Fixes

My variable shows as plain text (e.g., “@contact.firstname”)

Problem: The variable name is invalid, so it renders as text.

Fix:

  • Check spelling: it should be @contact.first_name (underscore matters).
  • Use the @ auto-complete to insert variables instead of typing manually.
I’m using “Send Message to Third Party” and @contact is confusing

Problem: You expected @contact to represent the notification recipient.

Fix:

  • Remember: @contact is the active contact in the run, not the recipient.
  • If you need the recipient’s details, start that recipient in a flow and message them there using a standard Send Message.
@fields.field_name is empty

Problem: The contact field is missing or has no saved value.

Fix:

  • Confirm the field exists in the workspace and the name matches exactly.
  • Ensure you updated/saved the value before referencing it.
  • Test with a known contact in the Simulator.
@results works, but @fields doesn’t

Problem: You collected a value in this run, but never stored it to the contact record.

Fix:

  • @results is only for values collected in the current run.
  • @fields only works if you stored the value into a contact field (usually via Update Contact).