Sorting & Grouping
Control the order of your line items in generated PDFs. TypeFlow uses your Airtable views to preserve sorting and filtering.
Overview
When you have line items in your documents (invoices, reports, etc.), you often need them in a specific order:
- Products sorted by name or SKU
- Line items sorted by date
- Tasks grouped by status
TypeFlow lets you use Airtable views to control this sorting - whatever order you see in your view is what appears in your PDF.
Sort Data in Airtable
Step 1: Go to Your Linked Table
Navigate to the Airtable table that contains your line items (the table your main record links to).
Step 2: Create or Select a View
Click the View dropdown and either:
- Select an existing view
- Create a new Grid view
Step 3: Add Sorting
- Click the Sort icon (two arrows)
- Select the field to sort by
- Choose Ascending or Descending
- Click Add sort for multiple sort levels
Step 4: Save the View
Give your view a descriptive name like "By Date (Newest First)" or "By Product Name A-Z".
Example Sort Configurations
| Use Case | Sort By | Order |
|---|---|---|
| Invoice line items | Date | Newest first |
| Product catalog | Product Name | A-Z |
| Task list | Priority, then Due Date | High to Low |
| Time entries | Date, then Start Time | Chronological |
Apply Sorting in TypeFlow
Step 1: Set Up Line Items
Make sure you've already configured line items in your template using {{loop_0}} or {{nested_0}}.
Step 2: Select Your View
In TypeFlow's line items configuration:
- Find the linked record section
- Look for the View dropdown
- Select the Airtable view you created
Step 3: Generate
When you generate your PDF, TypeFlow will use the sorting from your selected view.
Tip: Create multiple views for different document types. Use "Invoice Order" view for invoices and "Report Order" view for reports.
FAQ
Does TypeFlow preserve my Airtable sorting?
Yes. TypeFlow uses your Airtable views to maintain sorting and filtering when generating PDFs.
Can I sort by multiple fields?
Yes. Create a view in Airtable with multiple sort conditions, then select that view in TypeFlow.
How do I filter which line items appear?
Create a filtered view in Airtable that shows only the records you want, then select that view in TypeFlow.
What if I don't select a view?
TypeFlow will use the default record order from Airtable, which may not be what you expect. Always select a specific view for consistent results.
Related Articles
- Line Items - Basic line items setup
- Nested Line Items - Multi-level line items
Need More Help?
- Email: support@typeflow.us
- Chat: Click the chat icon in the app