1. [Help](https://nuvia.ai/en/docs)
2. [Campaigns](https://nuvia.ai/en/docs/colecoes/19377976-campaigns)
3. [WhatsApp Campaigns](https://nuvia.ai/en/docs/colecoes/19433179-whatsapp-campaigns)

# How to use variables in WhatsApp templates in Nuvia

Map contact fields to the variables of an approved template and personalize every campaign message at scale, with a real-time preview.

Available on

All plans

Who can do it

Any user with access to the Campaigns module

Updated on September 9, 2026

[WhatsApp Campaigns](https://nuvia.ai/en/docs/colecoes/19433179-whatsapp-campaigns)

1. [How to create and launch a WhatsApp campaign in Nuvia](https://nuvia.ai/en/docs/artigos/14501312-how-to-create-and-launch-whatsapp-campaign-nuvia)
2. [How the default text for template variables works](https://nuvia.ai/en/docs/artigos/16891724-how-default-text-for-template-variables-works)
3. [How to use variables in WhatsApp templates in Nuvia](https://nuvia.ai/en/docs/artigos/15353096-how-to-use-variables-in-whatsapp-templates)
4. [How to verify your business on Meta](https://nuvia.ai/en/docs/artigos/16548621-how-to-verify-your-business-on-meta)
5. [Best practices for Meta marketing templates](https://nuvia.ai/en/docs/artigos/16736964-best-practices-for-meta-marketing-templates)

Template variables let a campaign send the same message structure to hundreds of contacts, with the name, company or job title swapped for each recipient. You link each dynamic slot (#{{1}}, #{{2}}, #{{3}}) in the template to a contact field just once, inside the campaign step, and each person gets a message that feels written just for them.

**Available on:** All plans.

**Who can do it:** Any user with access to the **Campaigns** module.

## What you need before you start

-

At least one **[connected WhatsApp](https://nuvia.ai/en/docs/artigos/14489425-how-to-connect-whatsapp-to-nuvia)** inbox on the platform

-

At least one **Meta-approved template** linked to the inbox you'll use, with text variables (#{{1}}, #{{2}}, etc.). **Creating templates is covered in:[How to create WhatsApp templates with variables](https://nuvia.ai/en/docs)**

-

Audience contacts with the fields you'll map filled in (if you'll link #{{1}} to the name, contacts need the **Name** field filled in). When the data might be missing, use the **default text** described below

-

Access to the **Campaigns** module in the side navigation

### Set up variables in a campaign step

Mapping happens in **Step 3: Message sequence** of campaign creation. Each step in the sequence has its own template and its own mapping, independent of the others.

1.

In the side navigation, click **Campaigns**

2.

Click **New campaign**, or open an existing campaign in **Draft** status

3.

Fill in the name, select the **WhatsApp** channel and set up the audience in the previous steps

4.

In **Step 3**, click **Add step**

5.

In the **Connection** field, select the inbox (the sender) from the dropdown

6.

In **Send type**, select **Template**

7.

Click **Select template**. The dropdown only shows the approved templates for the chosen inbox

8.

Choose the template. The platform shows the variables it found (e.g. #{{1}}, #{{2}})

9.

For each variable, choose the matching contact field from the dropdown (if the variable fields were already mapped when the template was created, you don't need to assign them):

-

**Name**, **Email**, **Phone**, **Country** (fixed fields)

-

Custom fields created by the company admin

10.

If you want, fill in the **Default variable text**: the text that goes into the message when the contact doesn't have that data

11.

Follow the side **preview**, which updates in real time with data from a real contact in the audience

Important

How to create a template is covered in the article: **[How to create WhatsApp templates with variables](https://nuvia.ai/en/docs)**

[GIF: Selecting a template in the campaign]

### Check the mapping in the preview

The side preview uses real data from contacts in the audience, not made-up examples. This way you can check how the message will reach each prospect before launching.

1.

In the step list, click the step you want to check. The side preview updates on its own

2.

Use the **Previous** and **Next** arrows in the preview to go through different contacts in the audience

3.

Check that every variable shows the right value for each contact

4.

If a variable shows up empty, the platform shows an incomplete mapping warning. Fix it before launching

The preview already applies WhatsApp formatting: bold (*texto*), italics (_texto_) and line breaks look the way the recipient will see them in the app.

Each field's value goes into the preview exactly as it's saved, including when it has a currency symbol or punctuation (e.g. R$ 1.200,00). The text you see in the preview is the same text that goes out to the lead.

### Fields available for mapping

#### Fixed contact fields

Available for every contact on the platform:

FieldExample of use in the template

**Name** “Hi, #{{1}}! How are you?” becomes “Hi, John! How are you?”

**Email** “I sent some material to #{{1}}”

**Phone** Rarely used, since the message goes to the contact's number

**Country** “I saw you're in #{{1}}…”

The platform also offers fields derived from the full name, such as first name and last name.

#### Custom fields

Fields created by the company admin, which show up in the mapping dropdown. Both fields with the **Contact** context and fields with the **Mixed** context appear in the campaign message editor:

Example fieldExample of use

**Company** “I saw you work at #{{1}}…”

**Job title** “As #{{1}}, you probably deal with…”

**Industry** “We work with many companies in the #{{1}} industry…”

**City** “Great to talk to someone from #{{1}}!”

Important

Custom fields must be created by the admin in **Platform** before they show up in the mapping.

### Supported template components

Not every template component accepts variables. Here's what applies:

StatusComponentVariable support

✅ **Header (text)** Accepts 1 variable (#{{1}})

✅ **Body** Main component, accepts several variables (#{{1}}, #{{2}}, etc.)

❌ **Footer** Doesn't accept variables, it's fixed text only (Meta rule)

❌ **Buttons with fixed text** Don't use variables

⚠️ **Dynamic URL buttons** Limited support. Check with support whether your inbox and plan cover this case

### What happens at send time

Variables are resolved when each step is sent, not when the campaign is launched. In practice:

-

The platform fetches the contact's current data when it's time to send that step

-

If the contact's field changes between one step and the next, the next step uses the updated value

-

The field value is inserted into the text exactly as it's saved, with no extra character handling

-

If a contact doesn't have the mapped field filled in **and the variable has no default text**, the message isn't sent to them and the enrollment ends as a failure

-

If the variable **has default text**, the message goes out normally, with that text in place of the variable

Important

When a send fails because of an empty variable, the failure comes with a clear message naming the field to fill in by its friendly label (e.g. “Couldn't send the template: Company name is empty for this lead. Fill in the field and try again.”). If more than one field is empty, all of them are listed.

### Default text: send even when the contact doesn't have the data

Missing data is routine: a new lead has no city, a contact who came from a form has no company in the first few seconds. Before, a single empty variable dropped the whole message for that contact. With **default text**, you define what goes in place of the variable, and the message goes out.

#### Where to fill it in

The **Default variable text** block appears inside the step, both in **Step 3** of creation (under **Add step**) and when creating or editing a step on the campaign screen. It works for both send types:

-

**Template**: the block appears after you select the template, with one field per template variable

-

**Text**: the block appears below the message field, with one field per variable you typed

Each field is identified by the variable name (e.g. #{{var_contact_city}}), and the block's subtitle sums up the rule: “Optional. If the contact doesn't have the data, the message is sent with this text in place of the variable, instead of not being sent.”

1.

Set up the step as usual (inbox, send type, template or text)

2.

In the **Default variable text** block, fill in the field for the variable you want to protect (e.g. for the city, write **your area**)

3.

Leave blank the variables you **don't** want to protect. An empty field means “no default text”, that is, the old behavior

4.

Save the step

Tip

Protect variables for optional data (city, industry, job title) and leave the ones at the heart of the message without default text. If the company name is the whole personalization of the outreach, it's better not to send than to send “your company”.

#### What default text does and doesn't do

SituationWhat happens

Contact without the field filled in, variable **with** default text The message is sent with the default text in place of the variable

Contact with the field present, but **empty** Same as above: the default text is used too

Contact without the field filled in, variable **without** default text Same as before: the send fails and the failure names the field

Contact with the field filled in The contact's real value always wins. Default text is only used when the data is missing

**List column** variable (var_col_) Default text does **not** apply. An empty list column still drops the send

Template sent manually from inside a **conversation** Default text does **not** apply: it's a campaign step setting

#### Filling rules

Default text is validated when you save the step. Three things make the platform reject it:

RuleError message

No line breaks, tabs or more than four spaces in a row “Default text for X can't have line breaks, tabs or more than four spaces in a row.”

A single default text can't go over the message character limit “Default text for X exceeds the message limit: N characters fit.”

The sum of all default texts in the step can't go over the limit “The default texts combined exceed the message limit: N characters fit for all of them together.”

The calculation already deducts the space of the #{{…}} itself, which disappears when the default text goes in. The field also limits typing to the space available, as guidance: the final rejection comes from the platform when you save.

Important

In **template** steps, the platform only validates the character rules when saving, not the length: the template body is the one approved by Meta and doesn't go through this calculation. Meta's limit still applies at send time, so keep the default text short.

Good to know

If you edit the message and remove a variable, the orphaned default text is discarded on the next save. It's not an error and doesn't block editing, but you'll need to fill it in again if you add the variable back.

### Limits and rules

RuleValue

**Number of variables per template** Set when the template is created and approved. Nuvia doesn't add its own limit to the mapping

**Character limit** The message body, with variables filled in, can't go over 1,024 characters (Meta limit)

**Variable types** Text variables only (#{{n}}). Media variables (image, video, document) need separate setup

**Data source** Contact fields only (fixed or custom). You can't enter free text as a value

**Default text per variable** Optional, set in the campaign step. Applies to **template** and **text** steps. Doesn't apply to list column variables (var_col_) or to templates sent manually from the conversation

**Characters not allowed in default text** Line breaks, tabs and more than four spaces in a row

**Default text length** Each default text, and the sum of all of them in the step, must fit within the message character limit. In template steps, length isn't validated when saving, only the character rules

**Special characters in the value** The field value goes into the message exactly as saved, including currency symbols and punctuation (e.g. R$ 1.200,00). You don't need to escape anything, and the preview shows the same text that goes out to the lead

**Available templates** Only templates with **Approved** status from Meta

**Filter by inbox** The dropdown only shows templates for the inbox selected in the step

**After activation** The mapping and default text are part of the step content and can't be changed once the campaign is in **Active** status

**Recommendation** 2 to 3 variables per template. Meta also rejects templates with too many variables for the message length

**Variables at the edges** The body can't start or end with a variable, even when followed or preceded by punctuation (e.g. #{{1}}?, ? #{{1}}). The platform blocks saving with the message “The message body can't start or end with variables”

## Frequently asked questions

## Frequently asked questions

**What happens if the contact doesn't have the mapped field filled in?**

It depends on whether you set default text for that variable. With default text, the message is sent normally, with the text in place of the variable. Without default text, the message isn't sent to that contact and the failure names the empty field by its friendly label (e.g. “Couldn't send the template: Company name is empty for this lead. Fill in the field and try again.”). The platform never sends a template with a blank variable. Another way to avoid the failure is to filter the audience to include only contacts with the field filled in before launching.

**How do I make the message go out even when the contact doesn't have the data?**

Fill in the **Default variable text** block in the step. For each variable, you write the text that goes in when the contact doesn't have that field (e.g. “your area” for the city). A blank field means “no default text” and keeps the old behavior: an empty variable drops the send for that contact.

**Does default text also apply when the field exists but is empty?**

Yes. Both a field that doesn't exist on the contact and a field saved as blank trigger the default text.

**If the contact has the data, does the default text get in the way?**

No. The contact's real value always wins. Default text is only used when the data is missing.

**Does default text apply to list column variables?**

No. List column variables (var_col_) are resolved another way and still drop the send when the column is empty for that contact. Make sure the column is filled in on the List before launching.

**Can I set default text for a template I send manually from the conversation?**

No. Default text is a campaign step setting. When sending a template manually from the conversation, an empty variable still blocks the send, with a clear message for the agent.

**Can I use fixed text as a variable's value?**

No. Mapping only accepts contact fields, fixed or custom. If you need a fixed value in a spot in the template, include the text directly in the template when you submit it to Meta for approval, not as a variable. Default text is different: it doesn't replace the mapping, it only goes in when the mapped field is empty.

**Can I use a currency symbol (R$) in a variable's value?**

Yes. The field value is inserted into the message exactly as it's saved on the contact or in the list column: R$ 1.200,00 arrives as R$ 1.200,00. This applies both to the text that goes out to the lead and to the preview, which shows the same result. The same goes for any other punctuation in the field value.

**Can I use the same template in several campaign steps?**

Yes. You can select the same approved template in several steps, with the same or different mappings. This helps in follow-up sequences, where the message structure is similar but the context changes.

**Can I change the mapping after the campaign is launched?**

No. After activation, the step content, including the mapping and default text, is locked. To fix it, pause and archive the current campaign and create a new one with the right mapping.

**If the contact's name is updated after launch, which value is sent?**

The value at the time the step is sent, that is, the most recent one. The platform fetches the contact's current data every time a step runs and doesn't freeze the data at launch.

**If a step fails because of an empty variable, does the contact continue to the next steps?**

No. When a step send fails because of an empty variable, that contact's enrollment ends and the following steps don't run for them. That's why the default text needs to be set in the step before it's sent.

**What happens if I change the template after mapping the variables?**

The platform clears all previous mappings. Each template can have variables with different meanings, so you need to redo the mapping from scratch for the new template.

**Is there a limit on sends per minute when I use variables?**

No. Variables don't change sending speed. The same limits as any WhatsApp campaign apply: the inbox capacity and the API limits.

**Does the preview show exactly what the contact will receive?**

The preview shows the rendered message, with variables replaced and WhatsApp formatting applied. It doesn't show the technical payload (JSON) sent to the API. For a technical audit, check the run history after sending.

**Can the template start or end with a variable?**

No. Meta rejects templates whose body starts or ends with a variable, and the platform checks this before sending, including when the variable comes with punctuation, such as #{{1}}? or #{{1}}!. If you see the error “The message body can't start or end with variables”, move the variable to the middle of the text.

[PreviousHow the default text for template variables works](https://nuvia.ai/en/docs/artigos/16891724-how-default-text-for-template-variables-works) [NextHow to verify your business on Meta](https://nuvia.ai/en/docs/artigos/16548621-how-to-verify-your-business-on-meta)

Was this article helpful?

## Related articles

- [How to create and launch your first WhatsApp campaign in Nuvia](https://nuvia.ai/en/docs/artigos/14489458-how-to-create-and-launch-your-first-whatsapp-campaign)
- [Understanding WhatsApp rules: 24h and 72h windows and templates](https://nuvia.ai/en/docs/artigos/14575042-understanding-whatsapp-rules-24h-72h-windows-templates)
- [How to create and launch your first LinkedIn campaign in Nuvia](https://nuvia.ai/en/docs/artigos/15181600-how-to-create-and-launch-your-first-linkedin-campaign)
- [How to send Nuvia WhatsApp templates straight from a HubSpot workflow](https://nuvia.ai/en/docs/artigos/15879535-send-nuvia-whatsapp-templates-from-hubspot-workflow)

[WhatsApp Campaigns](https://nuvia.ai/en/docs/colecoes/19433179-whatsapp-campaigns)

1. [How to create and launch a WhatsApp campaign in Nuvia](https://nuvia.ai/en/docs/artigos/14501312-how-to-create-and-launch-whatsapp-campaign-nuvia)
2. [How the default text for template variables works](https://nuvia.ai/en/docs/artigos/16891724-how-default-text-for-template-variables-works)
3. [How to use variables in WhatsApp templates in Nuvia](https://nuvia.ai/en/docs/artigos/15353096-how-to-use-variables-in-whatsapp-templates)
4. [How to verify your business on Meta](https://nuvia.ai/en/docs/artigos/16548621-how-to-verify-your-business-on-meta)
5. [Best practices for Meta marketing templates](https://nuvia.ai/en/docs/artigos/16736964-best-practices-for-meta-marketing-templates)

## Still need help?

Customers reach support through the chat inside the platform. Not a customer yet? Talk to our team.

[Talk to support in the platform](https://app.nuvia.ai) [I'm not a customer yet](https://nuvia.ai/en/contact)

---
Source: https://nuvia.ai/en/docs/artigos/15353096-how-to-use-variables-in-whatsapp-templates
