Early access. Oomplo is looking for its first pilot companies. Tell us about your documents →

How fields and data work

A template is a Word document with places for data. This guide explains how those places read your data: single values, lists, related tables, and a whole spreadsheet of rows that becomes a document per row. For the editor's buttons, read Preparing a template. For the calls that send data, read the API guide.

In the editor, a green field reads one value, a purple field reads an item of a list (it repeats), and an orange field reads a row of a series (each copy of the document gets another row).

Fields and markers #

There are two ways to put a value into the text:

  • A data field. Choose Insert data and click a value, or select text and choose Turn into a field. The field is a Word content control, so it survives editing in Word and saving as DOCX. Click it to change its path, its format or its text when there is no data.
  • A marker. Type {{client.name}} anywhere in the text, also in Word before you import the file. The value takes the formatting of the marker's first character. A marker may take a format after its path: {{total \# "#,##0.00"}}.

Both read a path: where the value is in your data. A path starts with the name of a data source and goes down the data with dots, and with [0], [1] for the items of a list:

PathReads
client.namename inside client of the main JSON data (json.dane1)
json.offer.client.nameThe same in a JSON source named offer
json.dane1.items[0].priceThe price of the first item
xlsx.prices.Sheet1.B2Cell B2 of the sheet Sheet1 of the Excel source prices
csv.recipients.rows[0][1]The second column of the first row of a CSV file (without its header row)
table.clients.nameThe column name of the table clients (see related tables)

A path without a source (client.name) reads the main JSON data. A plain JSON object sent to the API is the main data, so client.name reads {"client": {"name": "…"}}. Values are text: data is never run as code and never read again as a marker.

Formats and empty values #

Click a field to choose how its value is written: dates (short, with the name of the month, with the day of the week, ISO, with the time), numbers (two decimals, an amount, a whole number) and letter case, or Word's own field switches:

SwitchExampleGives
\@ date\@ "d MMMM yyyy"12 March 2026
\# number\# "#,##0.00"4,200.00
\* case\* Upper (also Lower, FirstCap, Caps)CONTOSO LOGISTICS S.A.
\b, \f\b "Street "Text before (or after) a value that is not empty

Send dates as 2026-03-12 (or 2026-03-12T14:05:00Z) and numbers as JSON numbers. Month and day names follow the field's language (English, Polish, German).

When there is no data. Without data sets the text a field shows when the value is missing or empty, e.g. "to be agreed". A value missing without such a text stops the PDF with an error naming every missing path at once, so a half-filled document never reaches a customer. Send "missing": "empty" to the API to leave such values empty instead.

Data sources #

A template can read several data sources at once, each with its own name:

  • JSON: objects and lists of any depth. Also XML (an ERP export or a Polish KSeF e-invoice), read as JSON.
  • Excel (.xlsx, also .ods): cells by address (Sheet1.B2), or a sheet or a named Excel table as a list of rows with the column names as keys.
  • CSV: in UTF-8, UTF-16 or the encodings of a Polish Excel, with a comma, semicolon or tab between columns.

Add sources in Data in the toolbar. The template keeps them as sample data, so the preview shows a filled document while you work. Data sent to the API replaces them. GET /api/templates/{id}/schema lists every path the template reads and gives an example data file that fills all of them.

Repeated rows and paragraphs #

A table row with a field of a list item (items[].product) repeats once for each item of items. Choose Repeat row… to set it up, also for an Excel sheet or CSV rows. The header and the rows after it (a total, for example) stay as they are. With no items, only the repeated row goes away. A header row marked as such in Word repeats on every page.

Word's formula fields work on the filled table: =SUM(ABOVE) under the repeated rows adds up the rows the data gave. A field of a list item in an ordinary paragraph (not in a table) repeats the paragraph: a list of names, for example.

Repeated sections and nested lists #

Select paragraphs and tables and choose Repeat for each item…: the whole part repeats for each item, e.g. a heading and a table for each client. Inside it, a repeated row can read a list of the current item (clients[].items), so every client gets their own items. In Word the part is a repeating section content control.

Conditions #

Select paragraphs, or put the caret in a table row or table, and choose Show when…. The block stays in the PDF only when the value is filled in, is empty, equals, differs from, or is greater or less than a value you give. Numbers compare as numbers, everything else as text. A missing value is empty, and so are false, null and empty lists. Word shows the block always; only the PDF leaves it out.

Data often comes as tables that point to each other, like a database: clients, their orders, the lines of each order. Oomplo reads every list of objects, Excel sheet and CSV file as a table and finds its key (a column with a different value in every row, such as id) and the links between tables (a column clientId whose values are ids of clients). The Tables section of Document data shows them with the number of rows, the key and an arrow such as → clients at the linking column.

  • A field reads a column: table.clients.name.
  • A repeated row or section reads a table: table.orders[].product. It shows only the rows linked to the current row, so a client's document shows that client's orders, and inside each order its own lines.
  • Documents above the tables chooses one document or one for each row of the table (for example one for each client). Each document then shows its row (the current row), the rows it points to (one per document: the client of an order) and the rows that point to it (related rows only).
  • A field can also pick one row by its key, whatever document it is in: table.products[code="P-12"].price.

You do not have to join the data in your system first. Through the API, a series job can also join two Excel sheets by a key, e.g. invoices and their lines (series.join, see the API guide).

Pictures, check boxes and codes #

  • Pictures: a picture frame bound to a path shows the PNG or JPEG of the data (data:image/png;base64,… or plain base64), as large as fits. In a repeated row, each item gets its own picture.
  • Check boxes: a field marked as a check box shows ☒ for a true value (true, a number other than 0, text other than empty, 0, false, no) and ☐ otherwise.
  • QR codes and barcodes: QR, Code 128 and EAN-13 with a value from the data, for example a payment link or a parcel number.

Many documents from one template #

A series makes one copy of the template for each row of a spreadsheet, CSV file or JSON list. The row is the data of its copy: with a series named recipient, the fields read json.recipient.name, json.recipient.city and so on, with the column names as keys. Fields outside the series are the same in every copy. A Word mail-merge template becomes such a template on import.

In the editor, Generate from a file (or Download PDF in a template with a series) offers:

  • the visible row only;
  • one PDF to print: copy after copy, each from a new page with its own page numbers, and a PDF bookmark for each copy with its headings under it; two-sided printing starts each copy on an odd page;
  • a ZIP file with a separate PDF for each row.

Rows picks part of the series (1-3, 7; empty: all), and Copy name is a pattern for the bookmarks and file names, e.g. {{json.recipient.name}}. The window lists the copies and names a wrong row or a missing field before anything is made. A series has up to 1000 rows and 10,000 pages in one PDF.

The same through the API is a series job (POST /api/templates/{id}/jobs, see the API guide): Oomplo first fills the template with every row and answers with the failing rows before making anything, then makes the documents in the background and tells your webhook when they are ready. On the command line: oomplo pdf letter.docx --series recipient=recipients.xlsx --label "{{json.recipient.name}}" --zip --out letters.zip.