Polotno

InDesign Data Merge: how it works, and when to automate it instead

By Anton Lavrenov · Nov 23, 2026

InDesign Data Merge fills one layout with rows from a spreadsheet file and gives you one copy per row: letters, labels, badges, postcards. A person runs it from a panel in the desktop app. You outgrow it when the merge has to start from a web app, run on a schedule, or serve people who do not have InDesign.

How Data Merge works

Adobe describes three files:

  • The data source holds what changes. It is a comma-delimited, tab-delimited or semicolon-delimited text file. The first row names the fields, and each row after it is one record.
  • The target document is your InDesign layout. It holds the fixed content and a placeholder such as <<FirstName>> for each field.
  • The merged document is the output: the layout repeated once per record, with the placeholders filled.

A merge takes five steps:

  1. Save the spreadsheet as CSV, with the field names in the first row.
  2. Open the Data Merge panel from Window > Utilities and select the file as the data source.
  3. Place each field in a text frame. InDesign shows it as a placeholder in double angle brackets.
  4. Preview a few records in the layout.
  5. Choose Create Merged Document for a new InDesign file, or Export To PDF to go straight to a PDF.

The data source can also hold file paths that point to images on disk. The content placement options decide how each image sits in its frame: fitted proportionally by default, or filling the frame with the rest cropped.

Settings that save a rerun

These settings come from Adobe's documentation.

  • Several records on one page. Choose Multiple Records under Records Per Document Page for labels or business cards. It does not work when the fields sit on a page of a multi-page document or on more than one parent page, and every placeholder must be the same size.
  • Empty fields. A record with no second address line leaves a blank line. Turn on Remove Blank Lines For Empty Fields. A line that holds a single space stays, so clean the data first.
  • Commas and line breaks in a value. Wrap the value in double quotes. Without them, "Brady, Hunt, and Baxter, Inc." becomes four fields.
  • Accents, other scripts and emoji. Save the CSV as UTF-8 and use a font that has those glyphs.
  • Long names. A value longer than its frame becomes overset text, and InDesign hides it. Turn on Generate Overset Text Report With Document Creation to get a list of the records it happened to.
  • Missing images. Turn on Alert When Images Are Missing.
  • Large runs. Record Limit per Document splits the output into several files once a merged document reaches that many records.

Where Data Merge stops

Data Merge is a feature of the desktop app, and each limit follows from that.

  • A person starts every run. The merge begins from a panel menu. An order placed at 2 a.m. waits for someone to open InDesign.
  • The data is a file on disk. Rows from your database or CRM reach the merge as an exported CSV, with images saved to a folder first.
  • Everyone who merges needs InDesign. That includes the license, the document's fonts and the linked images on their machine.
  • Editing the template takes InDesign too. A print shop's client who wants a different headline asks a designer to change it.

Run the merge from code

The other route moves the template out of InDesign and keeps the design. With Polotno SDK it takes three steps.

1. Import the layout

Save the document as IDML in InDesign, then convert it:

ts
import { readFile } from 'node:fs/promises';
import { idmlToJson } from '@polotno/idml-import';

const template = await idmlToJson({
  idml: await readFile('./postcard.idml'),
  onWarning: (w) => console.warn(w.code, w.message),
});

Text frames, shapes, lines, pictures and tables arrive as separate, editable elements. The importer reports each feature it approximated or dropped through onWarning, so read that list before you trust a layout. Text wrap around objects and overset text are not imported, and line breaks match InDesign in most lines, not in all. The IDML import docs list every limit, and the IDML viewer shows the result for your own file without code.

Data Merge fields arrive as plain text, written the way InDesign shows them: <<FirstName>>. The importer does not turn them into variables, so you rewrite each one in the next step.

2. Mark what changes

A template variable is a named field in the design. In text you write it as a token, so Dear <<FirstName>> becomes Dear {{first_name}}. An image, a color or an element's visibility can be bound to a variable too, so a record can swap a photo or hide a badge.

You can set this up in code, or open the template in the editor and use its Variables panel. Your customers can use the same editor to change the template in a browser, inside your product.

3. Fill and render each record

js
import { createInstance } from 'polotno-node';
import { resolveVariables } from '@polotno/schema/variables';

const instance = await createInstance({ key: 'YOUR_API_KEY' });

for (const row of rows) {
  const { design, issues } = resolveVariables(template, row);
  if (issues.length) console.warn(row, issues);
  const pdf = await instance.jsonToPDFBase64(design);
  // save or upload the PDF
}

instance.close();

rows comes from wherever your data lives: a parsed CSV, a database query, a webhook payload. issues names the records with a missing required value or a value of the wrong type. Format prices and dates in your code before you pass them in.

For print, see how to generate a print-ready PDF. For the whole pipeline with proofing and batch rendering, see variable data printing.

Which one fits

InDesign Data MergeMerge from code
Who starts a runA person, in the desktop appYour code: an order, a schedule, an API call
Data sourceA delimited text file on diskAny data your code can read
Who edits the templateA designer with InDesignA designer, or your customers in a browser editor
TypographyEverything InDesign offersA subset; the import approximates drop caps, glyph scaling and custom tab stops
SetupNone beyond the app you ownIntegration work and a license

Stay with Data Merge when a designer runs a few merges a month and the layout leans on InDesign's typography. It is already installed and it does the job.

Move the merge to code when an event in your product should trigger it, when the volume is daily, or when the people who own the template are your customers.

Polotno SDK is a commercial license. You can evaluate it on a 30-day free trial, no credit card needed.

FAQ

Can InDesign Data Merge read an Excel file?

Adobe lists comma-delimited, tab-delimited and semicolon-delimited text files as data sources. Save the sheet as CSV, in UTF-8 if it holds accents or other scripts.

How do I merge several records onto one page?

Choose Multiple Records under Records Per Document Page when you merge. It does not work when the fields sit on a page of a multi-page document or on more than one parent page, and all placeholders must be the same size.

Can Data Merge export a PDF without creating an InDesign file first?

Yes. Export To PDF in the Data Merge panel menu merges the records and writes the PDF in one step.

Can I run a data merge without opening InDesign?

Data Merge itself runs in the desktop app. To merge without it, move the layout into a tool your code can drive. Polotno imports IDML, fills the template with one record at a time and renders each copy in Node or through a render API.

Can Polotno open my .indd file?

It reads IDML. Save the document as IDML in InDesign, or package it with Include IDML, and import that file.

Skip the build, cut dev costs, launch faster

TRUSTED BY

100,000+

CREATORS

300+

BUSINESSES

ExpediaUnbounceLovePopPostGridPredis.ai