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 Case | Primary Level | Secondary Level |
|---|---|---|
| E-commerce | Orders | Products in each order |
| Project Management | Phases | Milestones in each phase |
| HR/Equity | Grants | Vesting schedules |
| Education | Courses | Lessons in each course |
| Real Estate | Properties | Units 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
| Row | First Cell Variable | Other 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
- Select the linked record field for your primary items (e.g., "Orders")
- Map the fields from that table to your template variables
Step 3: Configure Secondary Level
- Select the linked record field within your primary table that connects to secondary items (e.g., "Products" within Orders)
- 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.
Related Articles
- Line Items - Basic single-level line items
- Sorting & Grouping - Organize your line items
Need More Help?
- Email: support@typeflow.us
- Chat: Click the chat icon in the app