# Map Variables in Template

When creating WhatsApp templates for business messaging, one of the most critical steps is mapping variables accurately. Variables (often referred to as placeholders like `{{1}}`, `{{2}}`, etc.) allow you to personalize messages dynamically—such as adding customer names, order IDs, or delivery dates. Proper variable mapping ensures that the right data is inserted into each placeholder when the template is sent, leading to a contextual, personalized experience for the end-user. This process is essential for compliance with WhatsApp’s policies, improving engagement, and maintaining message clarity. In this guide, we’ll explore how variable mapping works, best practices, and common pitfalls to avoid.

## Mapping Variables

{% stepper %}
{% step %}

#### Select template

Go to journeys or broadcasts and select a template which has variables. For this example, we are using Abandoned cart template.

<figure><img src="/files/JzO2NVBQa9rhYo2xLOAH" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Add Variables

#### 1. Click on "+ Dynamic Variable"

<figure><img src="/files/nRnh8xRrqCXnLDBolnDv" alt=""><figcaption></figcaption></figure>

#### 2. Select Source of the Dynamic value and Field Name

<figure><img src="/files/KVm1LA0WRUQPFqWom4Gg" alt=""><figcaption></figcaption></figure>

#### 3. Add Fallback (optional)

* Define fallback values for variables to avoid broken or awkward messages.
* Click on add fallback
*

```
<figure><img src="../../../../.gitbook/assets/image (85).png" alt=""><figcaption></figcaption></figure>
```

{% endstep %}

{% step %}

#### Save and continue

{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.quickreply.ai/product-modules/templates/whatsapp-templates/how-tos/create-templates/map-variables-in-template.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
