Skip to main content
DocsAutomator provides powerful capabilities for incorporating groups of variable-length data into documents. Line items represent lists of things where the quantity isn’t predetermined—such as invoice line items, conference attendees, or recipe ingredients.
Line Items = Groups of data / lists of things

Syntax

Line items are declared using the syntax {{line_items_$num}} at the beginning of a table row, with associated variables placed in subsequent cells.
To repeat a whole block of content per record — headings, paragraphs, and tables, e.g. one section per room or per project — add a closing tag and see Repeating Sections.

Data Source Mapping

Multiple Line Item Sets

Multiple line item sets can be included by incrementing the number:
Line item sets must be numbered in correct order (1, 2, 3, etc.).

Features

Adding Images in Line Items

Image placeholders use the {{image_name}} prefix and can map single or multiple images:

Grouping

Line items can be grouped by any variable except images. See Line Items Grouping + Calculations.

Conditional Display

Rows can be conditionally shown/hidden based on placeholder values through options/gear icons. See Conditional Show/Hide.

Conditional Styling

Text and rows support dynamic styling based on conditions:
  • Even/odd row alternating colors
  • Custom text formatting
  • Row background colors
See Conditional Styling.

Constraints

  • Variables must be unique per line item row
  • Line items must occupy entire rows, not partial rows
  • No limit on items passed (users report hundreds to thousands)
  • Each {{line_items_N}} number must be unique across the entire template — even if the tables are in mutually exclusive sections. Reusing the same number (e.g. {{line_items_1}} twice) causes a generation error.

API Example

When using the API, pass line items as an array of objects inside the data object:

Nested Line Items

Create hierarchical data structures

Grouping + Calculations

Group and calculate totals

Auto Row Numbers

Automatic row numbering

Template Guide

Complete template syntax
Last modified on August 28, 2026