Field Template
Field templates allow you to organize and structure your extraction fields in a predefined layout, creating groups of related entities that improve the annotation interface and directly impact the export structure.
Overview
Field templates are configured through the Template Editor in your pipeline settings. When enabled, field templates allow you to:
- Group entities together - Create logical groupings that help with organizing related fields
- Structure table-like data - Especially useful for organizing table rows and repeated groups
- Control export format - The template structure directly determines the format of your export object
- Influence validation context - Template grouping affects how context is assumed in further validation steps
Template Editor
The Template Editor is located in your pipeline settings under the extraction step validation settings. To use field templates:
- Enable template mode - Toggle "Format and display annotations in a predefined template"
- Create field entities first - Templates require existing field entities to work with
- Design your template structure - Use the visual editor to arrange entities in groups and layouts
Accessing the Template Editor
Navigate to: Project Settings → Pipeline → [Your Extraction Step] → Validation → Annotation template
The template editor becomes available when you enable the "Format and display annotations in a predefined template" option.
Creating Template Groups
Using the Template Editor, you can create groups to organize your fields:
Group Properties
- Group Name - Give your group a descriptive name (e.g., "Line Items", "Customer Information")
- Leading Field - Choose the primary field that drives the group (important for table rows)
- Grouping Type - Select how fields should be grouped together
Grouping Types
TABLE Grouping (Default)
- Best for structured data like tables, invoices, and forms
- Groups fields based on their position on the document
- Ideal for repeating rows of data (like line items)
TEXT Grouping
- Best for sequential text documents
- Groups fields based on reading order
- Maintains the natural flow of the document text
Impact on Export Structure
The template structure directly affects how your extraction data is exported:
Without Template (Flat Export)
{
"annotations": [
{ "entity_id": "vendor_name", "value": "ACME Corp" },
{ "entity_id": "invoice_number", "value": "INV-001" },
{ "entity_id": "line_item_desc", "value": "Product A" },
{ "entity_id": "line_item_amount", "value": "100.00" }
]
}
With Template (Grouped Export)
{
"annotations": {
"vendor_name": { "entity_id": "vendor_name", "value": "ACME Corp" },
"invoice_number": { "entity_id": "invoice_number", "value": "INV-001" },
"line_items": [
{
"line_item_desc": { "entity_id": "line_item_desc", "value": "Product A" },
"line_item_amount": { "entity_id": "line_item_amount", "value": "100.00" }
}
]
}
}
Template Examples
Invoice Template Structure
For an invoice document, you might create groups like:
- Vendor Information - Company name, address, tax ID
- Invoice Details - Invoice number, date, due date
- Line Items - Product description, quantity, price, total
- Summary - Subtotal, tax, final total
Table Data Template
For documents with repeating table rows:
- Set the leading field to the first column (e.g., product description)
- Use TABLE grouping to capture rows based on position
- Group all related columns together (description, quantity, price)
- The system will automatically create multiple rows as it finds matching patterns
Validation and Context
Template grouping enhances validation in several ways:
Grouped Field Validation
- Fields in the same group can reference each other for validation
- Business rules can work across related fields more effectively
- Lookup validation can use context from other group fields
Leading Field Importance
- The leading field you choose determines how the system groups related data
- For table rows, pick the most consistent field (usually the first column)
- This helps the system understand which annotations belong together
Best Practices
Template Design
- Start simple - Begin with basic grouping before adding complexity
- Use meaningful names - Give groups descriptive names for clarity
- Consider document structure - Match template layout to document organization
- Test with real data - Validate template behavior with actual documents
Field Organization
- Group related fields - Put logically connected fields together (e.g., all address fields)
- Choose the right leading field - Pick the most consistent field as the group leader
- Use appropriate grouping - TABLE for structured data, TEXT for flowing documents
- Plan for repetition - Consider how your template handles repeating sections
Working with Exports
- Preview your structure - Check how grouping affects your exported data format
- Consider integrations - Ensure your grouped structure works with downstream systems
- Keep it simple - Balance organization with ease of use
Field templates provide powerful organization tools while maintaining flexibility for diverse document types and processing requirements.