Nested Line Items

Display hierarchical data in your documents - items within items. Perfect for complex structures like orders with products, projects with phases, or participants with grants.


Overview

Standard line items work at a single level. But what if you need to show:

  • Customers → each with multiple Orders → each with multiple Products
  • Projects → each with multiple Phases → each with multiple Tasks
  • Participants → each with multiple Grants → each with multiple Vestings

Nested line items solve this by allowing two levels of hierarchy in your document.


When to Use Nested Line Items

Use CasePrimary LevelSecondary Level
E-commerceOrdersProducts in each order
Project ManagementPhasesMilestones in each phase
HR/EquityGrantsVesting schedules
EducationCoursesLessons in each course
Real EstatePropertiesUnits in each property

If your data has a parent-child-grandchild relationship, nested line items are what you need.


Google Docs Template Setup

Step 1: Create a Two-Row Table

Create a table with:

  • Row 1: Primary level (parent items)
  • Row 2: Secondary level (child items)

Step 2: Add Nested Variables

RowFirst Cell VariableOther Cells
Row 1 (Primary){{nested_0}}Fields from primary table
Row 2 (Secondary){{nested_items_0}}Fields from secondary table

Example: Orders with Products

| Order # | Customer | Order Date |
|---------|----------|------------|
| {{nested_0}} {{Order Number}} | {{Customer Name}} | {{Order Date}} |
| {{nested_items_0}} {{Product Name}} | {{Quantity}} | {{Price}} |

Key Points

  • {{nested_0}} goes in the first cell of the primary row
  • {{nested_items_0}} goes in the first cell of the secondary row
  • Use {{nested_1}} and {{nested_items_1}} for additional nested groups

TypeFlow Configuration

Step 1: Refresh Template

After adding nested variables to your Google Doc, refresh your template in TypeFlow. A new Nested Items section will appear.

Step 2: Configure Primary Level

  1. Select the linked record field for your primary items (e.g., "Orders")
  2. Map the fields from that table to your template variables

Step 3: Configure Secondary Level

  1. Select the linked record field within your primary table that connects to secondary items (e.g., "Products" within Orders)
  2. Map the fields from that table

Step 4: Generate

Test your document - TypeFlow will automatically create the nested structure with all your data.


FAQ

What are nested line items?

Nested line items allow you to display hierarchical data - items within items. For example, a customer with multiple orders, where each order has multiple products.

How many levels of nesting can I have?

TypeFlow supports two levels of nesting: a primary level (e.g., Orders) and a secondary level (e.g., Products within each Order).

What's the difference between loop and nested variables?

Use {{loop_0}} for simple line items from one linked table. Use {{nested_x}} and {{nested_items_x}} when you need two levels of hierarchy.

Can I combine regular line items with nested line items?

Yes. You can have both {{loop_0}} tables and {{nested_0}} tables in the same document.



Need More Help?

Was this page helpful?