Skip to content

Variable & Media Mapping

Variable and media mapping is the connecting step between the message template and the audience. Before a campaign can be activated, every variable placeholder in the template ({{1}}, {{2}}, … or {{nama}} for SMS) and every media header (IMAGE, VIDEO, DOCUMENT) must be mapped to a CSV column or contact field. This step is intended for campaign operators who have already created a campaign draft and just need to fill in dynamic values before sending.

You access this feature from campaign detail page with DRAFT status — the Map Template Content (lihat di portal) card. This card appears automatically after you save the campaign from Creating a Broadcast Campaign, right above the activation card. There is no direct route — the card only shows while the campaign is still DRAFT and the template/message content actually requires mapping.

The mapping card is only shown for WhatsApp and SMS campaigns with DRAFT status that actually require mapping. In addition, its appearance depends on the template content and the audience condition:

ConditionWhat is displayed
WhatsApp Carousel template (component CAROUSEL)The Carousel Mapper interface for mapping media headers and variables on each card (2–10 cards).
Template/SMS content has variables or media headersFull mapping form (header and/or body variables)
Template without variables and without media headersMessage: “This template does not contain any variables to map.”
CSV audience not yet fully processedWarning “Audience is still processing. Mapping will be available once it’s complete.” — mapping is locked until COMPLETED
No template/SMS content yet, or no audience yet (and not a date-based campaign)Card is not displayed at all

Previously saved mapping will be automatically reloaded when you reopen the card, so you can edit it without filling it in from scratch.

The Media Header section only appears if the HEADER on the template is in IMAGE, VIDEO, or DOCUMENT format. Two mode tabs are available:

TabHow it works
Static (Same for All)The same media is sent to all recipients. Paste a public URL of the media, or click the upload button to upload a file directly.
Dynamic (Per Contact)Different media per contact. Select one audience column that contains the media URL. The column must contain valid, publicly accessible URLs.

When you upload a file in Static mode, the accepted file types follow the header format: image/* component for IMAGE, video/* for VIDEO, and .pdf for DOCUMENT. The resulting URL is automatically filled into the field after a successful upload.

The Body Variables section shows one row for each placeholder found:

  • WhatsApp — numbered placeholders in the template body, e.g. {{1}}, {{2}} section (duplicates merged).
  • SMS — placeholder in Message Body, extracted from the SMS text.

For each placeholder, select a CSV column or contact field from the dropdown. The available options depend on the audience type (see the table below).

The list of options in the dropdown — for both dynamic headers and body variables — is taken from the campaign’s audience type:

Audience typeAvailable fields
CSV Upload (CSV_UPLOAD)Column headers from the CSV file, excluding empty columns and the column phone_number. Only available after the audience processing status COMPLETED.
Static list / Single recipient (STATIC_LIST / SINGLE_RECIPIENT)Contact Name, Contact Email, Contact Phone Number, plus all custom contact properties.
Date-based (DATE_TRIGGER)Same as static list (contact fields + custom properties), or CSV columns if the audience source is a CSV — both always in addition to computed system variables.

Custom contact properties are taken from GET /api/contact-properties and are marked with a label ending in (Custom).

System variables only appear on campaigns that are Date-Triggered. Their values are calculated automatically from the contact’s date properties, not taken raw from the column:

ValueLabel in the portalDescription
_ageAge in years (computed)Age in years, computed from the contact’s date property.
_years_sinceYears since (computed)Number of years since the reference date.
_days_untilDays until date (computed)Number of days until the reference date.
FieldRequiredDefaultDescription
Media Header (IMAGE / VIDEO / DOCUMENT)Yes, if the template has a media header—URL or media file above the message. Stored with the key header_image, header_video, or header_document.
Header mode (tab)—StaticChoose between static media (the same for everyone) or dynamic (per contact).
Static URLYes, in Static mode—Paste a public media URL, or upload a file to fill it in automatically.
Dynamic columnsYes, in Dynamic mode—An audience column containing a public media URL per contact.
Body variables ({{1}}, {{2}}, …)Yes—Every placeholder must be mapped to one audience column/field before it can be saved.

When the campaign uses a WhatsApp template with the Carousel format, the mapping card automatically switches to the Carousel Mapper:

  • The system retrieves the authoritative card slot definitions via the endpoint /api/campaigns/{id}/carousel-slots.
  • Operators map the media header and body variables independently for each card (between 2 and 10 cards).
  • A sample CSV template download button is available (campaign_{nama}_carousel_template.csv) that includes all the required header columns and card parameters so operators can easily match the structure of the audience CSV file.
ActionResult
Upload (cloud icon, Static mode)Uploads a media file to storage and fills in the URL automatically.
Save MappingStores the entire mapping to the campaign (audience_column_mapping). Validation requires every variable to be mapped — if any is empty, saving is rejected with the message “You must select a column or field for each variable.”

Once the mapping is saved, continue to the activation card to activate the campaign, then Send Now or schedule the delivery.