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.
{{line_items_1}}{{description}}  {{quantity}}  {{price}}

Data Source Mapping

Data SourceMapping Method
AirtableAutomation interface
NotionRelation property → related pages
Google SheetsLinked sheet selection
SmartSuiteLinked field mapping
GlideWithin Glide interface
NolocoWithin Noloco interface
ZapierZapier configuration
APIArray of objects

Multiple Line Item Sets

Multiple line item sets can be included by incrementing the number:
{{line_items_1}}{{description}}  {{quantity}}  {{price}}

{{line_items_2}}{{name}}  {{amount}}
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:
{{line_items_1}}{{image_product_photo}}  {{name}}  {{price}}

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:
{
  "docId": "your-automation-id",
  "data": {
    "customer_name": "Acme Corp",
    "invoice_date": "2024-01-15",
    "line_items_1": [
      {
        "description": "Widget A",
        "quantity": 2,
        "unit_price": 10.00,
        "total": 20.00
      },
      {
        "description": "Widget B",
        "quantity": 1,
        "unit_price": 25.00,
        "total": 25.00
      }
    ]
  }
}

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 May 26, 2026