Repeating sections in DOCX templates


In this section, we'll explore how to implement complex scenarios with nested structures, such as tables, bullet lists, and chapters, using the AutomatedDocs templating engine. For guidance on creating basic bullet lists and tables, please refer to the relevant sections of this documentation.

Overview

The templating engine enables the creation of various repeating objects, which can be nested within each other to form complex document structures. This includes:

  • Tables
  • Bullet lists
  • Chapters

To understand how to utilize loops and nesting effectively, first review the loops and nesting demo.

Example Scenario

Let's consider a simplified version of a source object from our demo. This example involves offering a customer two alternative quotes, each containing its own list of products, a name, description, and specific sales conditions.

AutomatedDocs - Barcode Example

JSON Object

The JSON object for this example is structured as follows:

{
    "Customer_Name": "Signe Greene",
    "Customer_Address": "P.O. Box 922, 1251 Nunc, Road",
    "repeating_section": [
        {
            "alternative_name": "Harken",
            "alternative_description": "Harken Blocks for boats",
            "Products": [
                {
                    "product_name": "HARKEN FLY 18 MM DOUBLE",
                    "product_price": "55",
                    "product_qty": "1",
                    "product_total": "55"
                },
                {
                    "product_name": "HARKEN FLY 29 MM SINGLE",
                    "product_price": "1",
                    "product_qty": "30",
                    "product_total": "30"
                }
            ],
            "sales_conditions": [
                "No Refund after 14 days",
                "2 year worlwide warranty"
            ]
        },
        {
            "alternative_name": "Ronstan",
            "alternative_description": "Ronstan Blocks - EU Made",
            "Products": [
                {
                    "product_name": "Ronstan S60 BB Ultimate",
                    "product_price": "120",
                    "product_qty": "1",
                    "product_total": "120"
                },
                {
                    "product_name": "Ronstan S30 BB",
                    "product_price": "35",
                    "product_qty": "1",
                    "product_total": "35"
                }
            ],
            "sales_conditions": [
                "No Refund after 14 days",
                "2 year warranty"
            ]
        }
    ]
}

Generated Document The generated document will contain two sections, each corresponding to an alternative provided in the JSON object.

AutomatedDocs - Barcode Example

{info} Note: Repeating sections are supported only through our API or webhook integrations. They are not currently supported with Excel or Google Sheets integrations.