Skip to main content

Variables and Examples

Variables (also called placeholders) are the fill-in-the-blank parts of your template. They get replaced with actual values each time you send a message.

How Variables Work

When you write your template body like this:

Hello {{customername}}, your order {{orderid}} has been shipped!

Each time you send this template, you provide the actual values:

  • {{customername}} → "Rahul Kumar"
  • {{orderid}} → "ORD-5678"

The customer receives:

Hello Rahul Kumar, your order ORD-5678 has been shipped!


Positional vs Named Variables

Positional Variables

Use numbers: {{1}}, {{2}}, {{3}}

Hello {{1}}, your order {{2}} has been shipped. Delivery by {{3}}.

Rules:

  • Must start with {{1}}
  • Must be in order — {{1}}, {{2}}, {{3}} (no gaps)
  • Cannot skip numbers (e.g., {{1}} then {{3}} without {{2}})

Named Variables

Use descriptive names: {{customername}}, {{orderid}}

Hello {{customername}}, your order {{orderid}} has been shipped. Delivery by {{deliverydate}}.

Rules:

  • Must use only lowercase letters (a to z)
  • No numbers, spaces, underscores, or special characters in the name
  • Good: {{customername}}, {{orderid}}, {{deliverydate}}
  • Bad: {{customer_name}}, {{order123}}, {{Order_ID}}

Where Can You Use Variables?

ComponentVariables allowed?
Header (Text)Yes
BodyYes
FooterNo — plain text only
Button TextNo
Button URLYes — in the URL link only

Providing Example Values

WhatsApp requires example values for every variable in your template. These examples help WhatsApp understand what kind of data will fill each placeholder during their review.

Where to find the examples section

When your template has variables, a Variable Examples section appears below the components area. It is organized by component:

  • Header Variables (purple section) — For any variables in your header text
  • Body Variables (green section) — For any variables in your body text
  • URL Button Variables (orange section) — For any variables in your button URLs
📸
Screenshot: Variable Examples section — Header (purple), Body (green), URL Button (orange)
variable-examples-section.png
1. On the Create Template page, create a template with variables in body and header
2. Scroll down to the "Variable Examples" card
3. Fill in some examples, leave some empty to show yellow/green highlighting
4. Capture the entire Variable Examples card showing all sections
Save to: static/img/screenshots/templates/variables-and-examples/variable-examples-section.png

What to enter as examples

VariableGood example
{{customername}} or {{1}} (for name)John Smith
{{orderid}} or {{2}} (for order)ORD-12345
{{deliverydate}} or {{3}} (for date)15 Jan 2025
{{amount}} or {{4}} (for price)1,299.00
{{trackinglink}} (in URL button)ABC123XYZ
Required

All variable examples must be filled in before you can submit the template. The submit button stays disabled until every example has a value.

How examples appear in the preview

On the right side of the screen, the WhatsApp Preview shows your template with:

  • Yellow highlighted placeholders → Example value is missing (needs to be filled)
  • Green highlighted placeholders → Example value is provided (good to go)

Once all placeholders turn green, you are ready to submit.


Tips for Variables

Best Practices
  1. Keep variable count low — Templates with fewer variables are easier to use and less likely to be rejected
  2. Use clear names — If using named variables, pick names your team will understand
  3. Provide realistic examples — Use values that look real (not "test123" or "xxx")
  4. Don't overuse variables — Only make parts variable that actually change per customer