> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pocketflows.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How personalization variables work

> How the data you sync and track is filled into each message a business sends

A variable is a placeholder in a message, such as `{{ customer.first_name }}`,
that Pocketflows replaces with a real value when the message is sent. Variables
are how one email or SMS reads as if it were written for each person who
receives it.

For the full list of names, see [Variables](https://docs.pocketflows.com/reference/variables.md).

## Where the values come from

You do not create variables. They come from the data that is already in
Pocketflows, most of which you put there:

| A variable that starts with | Is filled from | Which you provide by |
| - | - | - |
| `customer.` | The customer receiving the message, and its `metadata` | [Syncing customers](https://docs.pocketflows.com/how-to/sync-businesses-and-customers.md) |
| `business.` | The business sending the message, and its `metadata` | [Syncing businesses](https://docs.pocketflows.com/how-to/sync-businesses-and-customers.md) |
| `event.` | The event that started a trigger, and its `data` | [Tracking events](https://docs.pocketflows.com/how-to/trigger-messages-from-events.md) |
| `campaign.` or `trigger.` | The campaign or trigger the message belongs to | The business, when it builds the campaign or trigger |

So the way to offer a new variable is to sync or track a new piece of data. If
you add `next_appointment` to a customer's `metadata`, businesses can write
`{{ customer.next_appointment }}`. If you send `service` in an event's `data`, a
trigger for that event can use `{{ event.service }}`.

This is the same data that powers segments. A property you sync once can be both
a filter a business segments on and a variable it writes into a message. See
[How segments and filter definitions work](https://docs.pocketflows.com/concepts/segments-and-filters.md).

## Filled in per recipient, at send time

A variable is filled in separately for every recipient, at the moment each
message is sent. Two consequences follow:

* A message always uses the current value. If a customer's `metadata` changes
  between when a campaign is written and when it is sent, the new value is used.
* `business.` variables are the same for every recipient of one business, while
  `customer.` variables differ for each one. This is why a template shared
  across businesses can still mention each business by name.

## How businesses find variables

In the embed, a business picks from a list of variables rather than typing names
from memory. Pocketflows builds that list by looking at the business's own data:
the business's `metadata`, and the properties and `metadata` found on a sample
of its customers.

Because the customer list is built from a sample and refreshed periodically, a
`metadata` key you start syncing may not appear in the list for up to an hour. A
key that only a few customers have may not appear at all, although it still
works if typed.

## When a value is missing

If a message uses a variable and the recipient has no value for it, Pocketflows
does not send that message to that recipient. It does not send the message with
a blank in it.

For campaigns and triggers, the message is retried about once a day, and sent as
soon as the value exists. After five failed attempts, it is abandoned for that
recipient. Other recipients are not affected.

This makes variables safe to use, and it also means a variable should only be
used when every intended recipient has a value. If only some customers have a
`next_appointment`, send that message to a segment of the customers who do.

## Related

* [Variables](https://docs.pocketflows.com/reference/variables.md) for the syntax and every built-in name.
* [How pre-built templates work](https://docs.pocketflows.com/concepts/templates.md) for using variables in
  content shared across businesses.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.