Browse guides

Template Variables vs Custom Variables — What's the Difference with ChatSyncs?

The difference between a Template Variable and a Custom Field in WhatsApp message templates, when to use each, and how each behaves in the API.

On this page

Inside a Message Template body, a Template Variable and a Custom Field look almost the same: a Custom Field is written #fieldname#, and a Template Variable adds an exclamation mark on each side, #!variablename!#. That's exactly why they confuse people: #!price!# and #name# look like the same kind of thing, but where each one gets its value from is completely different.

One example, both types#

Imagine an order confirmation template with this body:

text
Hi #name#, thanks for shopping with us!

Your #!product_name!# (#!price!#) has been confirmed.
Order ID: #!orderid!#
Arriving: #!delivery_date!#

We'll deliver to your address in #city#.
PlaceholderTypeWhere the value comes from
#name#Custom FieldStored on the subscriber's profile — set once, reused forever
#city#Custom FieldStored on the subscriber's profile — set once, reused forever
#!product_name!#Template VariableTyped in fresh, every time you send this template
#!price!#Template VariableTyped in fresh, every time you send this template
#!orderid!#Template VariableTyped in fresh, every time you send this template
#!delivery_date!#Template VariableTyped in fresh, every time you send this template

#name# and #city# almost never change for a given subscriber, so they're stored once and reused automatically. #!product_name!#, #!price!#, #!orderid!#, and #!delivery_date!# are different on every single order — nobody would want to permanently store "₹499" on a subscriber's profile, so those get typed in fresh each time you send.

Quick comparison#

Template VariableCustom Field
Looks like#!price!#, #!orderid!#, #!delivery_date!##name#, #city#, #company_name#
Where createdMessage Templates → Template Variables sectionSubscriber Manager → How Do I Manage Custom Fields, Labels, and Lists?
Data storageTemporary — you supply it every time you sendPermanent — stored on the subscriber's profile
Attached toThe messageThe subscriber
Best forData that changes every send: prices, order numbers, delivery dates, OTPsData that rarely changes: name, company, email, city
API behaviorYou must pass the value on every sendChatSyncs pulls it automatically — no need to pass it

Template Variables#

Video walkthrough: Use a Template Variable in a message template.

A Template Variable is a placeholder that changes with every message — it isn't stored anywhere, so you type the real value in fresh each time you send. Use it for anything unique to that one message: a price, an order number, a delivery date, an OTP code.

Create one from Chatbot Manager → Automation → Message Templates → Template Variables:

Message Templates page with the Variables tab selected, showing a list of custom variables and a Create button
  1. Click Create

    Open the Template Variables list and click Create.

  2. Name it

    Give it a plain name with no spaces or special characters, e.g. price, orderid, delivery_date, product_name.

  3. Save

    It now appears in the list and can be inserted into any template's Message Body from the Variables picker.

text
Your #!product_name!# (#!price!#) will arrive on #!delivery_date!#.

For one customer this might render as:

text
Your Bluetooth Speaker (₹1,499) will arrive on Feb 18.

For the next customer, same template, completely different values:

text
Your Running Shoes (₹2,999) will arrive on Feb 20.

When sending via the ChatSyncs API, a Template Variable needs its value filled in for that specific send — the API Developer Console prompts you for a value for every Template Variable the chosen template has, since there's no stored value to fall back on.

Custom Fields#

Video walkthrough: Use Custom Fields in message templates.

A Custom Field (see How Do I Manage Custom Fields, Labels, and Lists?) stores one persistent piece of data per subscriber — their name, city, email, or company — that stays on their profile until it's changed.

Manage Custom Fields panel with a Create Custom Field button and a list of fields including status, Phone, Email, Designation, Department, Name, and employee id, each showing its type

Insert it from the Custom Fields picker in the Message Body — it's written with a single # on each side, without the ! a Template Variable has:

text
Hi #name#, welcome back to #company_name#!

Before this can send a real value, the Custom Field must already have data on that subscriber — set manually, via CSV/Google Sheet import, or through the Subscriber Update API. If the field is empty for a given subscriber, that part of the message sends blank.

Because ChatSyncs pulls a Custom Field's value straight from the subscriber's stored profile, you don't fill it into the API Developer Console the way you do a Template Variable — it's already there, waiting to be used.

Which should you use?#

Ask: "Will this value change every time I message this person?"

  • Yes → Template Variable — #!price!#, #!orderid!#, #!delivery_date!#, an OTP code
  • No → Custom Field — #name#, #company_name#, #city#, an email address

Frequently asked#

My API call sent a template with blank values — why?

If you used a Custom Field, check that the subscriber actually has a value stored for it — an empty Custom Field sends blank. If you used a Template Variable, make sure you supplied a value for it in that specific send; Template Variables aren't stored anywhere and need a fresh value every time.

Do I need to pass Custom Field values in my API call?

No — ChatSyncs pulls Custom Field values automatically from the subscriber's stored profile. Only Template Variables need to be supplied on every send.

I want to personalize a template with a price or order number that's different every time — Variable or Custom Field?

Template Variable — a price or order number changes on every send, so it shouldn't be stored permanently on the subscriber.

Can I combine a Custom Field and a Template Variable in the same message?

Yes — see the order confirmation example above. #name# and #city# are Custom Fields; #!product_name!#, #!price!#, #!orderid!#, and #!delivery_date!# are Template Variables, all in the same template body.

How do I tell a Template Variable from a Custom Field in the message body?

Look for the exclamation marks. A Template Variable is written #!variablename!# (for example #!price!#); a Custom Field is written #fieldname# (for example #name#). Insert each from its own picker (Variables or Custom Fields) rather than typing the syntax by hand.

Gotchas & common mistakes#

Watch the video lesson

Still stuck? Open a support ticket and our team will help.