Skip to main content

Template Creation Tutorial

Learn how to create document processing templates using Parselyze's visual template editor. Templates define what data to extract from your documents and are required for API usage.

Required for API Usage

Templates must be created through the web interface before you can use them with the API. This tutorial will guide you through the process step by step.

What You'll Learn

  • How to create a new template from scratch
  • Configure template fields with various data types
  • Work with nested fields and arrays
  • Test your template with sample documents
  • Get your template ID for API usage

Prerequisites

  • A Parselyze account
  • Access to the web dashboard
  • Sample documents to test your template

Step 1: Access the Template Editor

  1. Log in to your Parselyze account
  2. Navigate to the "Dashboard"
  3. Click "Create Template" button

Template Creation Dashboard

You'll see the template creation interface with a comprehensive progress indicator showing your completion status across different areas.

Step 2: Template Information

Basic Configuration

Template Name (Required)

  • Enter a descriptive name for your template
  • Example: "Standard Invoice Template" or "Medical Report Processing"
  • This helps you identify the template later and appears in the marketplace

Category Selection (Required) Choose the appropriate category for your document type:

  • Invoice - For invoices and billing documents
  • Receipt - For receipts and payment confirmations
  • ID Document - For identity documents and cards
  • Contract - For contracts and agreements
  • Medical Record - For medical documents and reports
  • Resume - For CV and resume processing
  • Custom - For specialized document types

Description (Optional but Recommended) Add a description to help others understand:

  • What this template is for
  • When to use it
  • Any special considerations
  • Example use cases

Step 3: Template Fields

This is the core of your template - defining what data to extract from documents.

Template Fields Configuration

Adding Fields

  1. Click "Add field" to create a new extraction field
  2. Configure each field using the expandable field editor
  3. Use the Guide button for detailed field configuration help

Field Configuration

Each field can be configured with these options:

Basic Field Properties

Field Name (Required)

  • Unique identifier for the data (e.g., "invoice_number", "total_amount")
  • Use descriptive names that make sense for your API consumers
  • Avoid spaces and special characters

Field Type (Required) Choose the appropriate data type:

  • String - For text data like names, addresses, descriptions
  • Number - For numerical values like amounts, quantities, IDs
  • Date - For dates and timestamps
  • Boolean - For yes/no, true/false values
  • Object - For nested data structures
  • Array - For lists of items (like invoice line items)

Description (Optional)

  • Explain what this field represents
  • Provide examples of expected values
  • Document any special formatting requirements

Advanced Field Types

Object Fields For complex data structures containing multiple sub-fields:

  1. Select "Object" as the field type
  2. Add nested fields using the "Add property" button
  3. Configure each sub-field with its own type and properties
  4. Example: Customer information with name, address, and contact details

Array Fields For lists of similar items:

  1. Select "Array" as the field type
  2. Choose the array item type (string, number, date, boolean, or object)
  3. For object arrays, define the structure of each item
  4. Example: Invoice line items with product, quantity, and price

Field Management

Field Actions Each field provides several management options:

  • Duplicate - Copy field configuration for similar fields
  • Reset - Restore field to default values
  • Delete - Remove field from template

Step 4: Template Preview

The preview section provides real-time feedback on your template:

Template Preview

Step 5: Testing Your Template

Sample Data Generation

The system automatically generates sample data based on your field configuration:

  • Preview the expected JSON output structure
  • Validate field types and nested structures
  • Ensure the template meets your requirements

Template Testing

  1. Review the generated sample to verify structure
  2. Check field types and nesting levels
  3. Validate required fields are properly configured
  4. Test with actual documents using the API once saved

Live Testing

Premium users can test their templates directly within the editor without consuming their API quota. This allows you to validate your template's accuracy before deploying it in production. See Template Testing documentation for detailed instructions.

Step 6: Saving and Using Your Template

Save Your Template

  1. Click "Create" (for new templates) or "Update" (for existing ones)
  2. Template ID will be generated automatically
  3. Copy the Template ID using the "Copy ID" button

API Integration

See Document Processing API.

Template Management

  • Edit templates anytime from the Templates list
  • Delete templates you no longer need
  • Share templates with the community via the Publish feature

Best Practices

Field Naming

  • Use clear, descriptive names
  • Follow consistent naming conventions
  • Avoid spaces and special characters
  • Use snake_case or camelCase

Template Organization

  • Group related fields logically
  • Use objects for complex data structures
  • Leverage arrays for repeated items
  • Keep the structure intuitive

Testing and Validation

  • Test with multiple document samples
  • Validate all field types work correctly
  • Ensure required fields are properly marked
  • Check nested structures are complete

Marketplace Sharing

  • Write comprehensive descriptions
  • Include usage examples
  • Follow naming best practices
  • Test thoroughly before publishing

Troubleshooting

Common Issues

Template Not Saving

  • Check all required fields are filled
  • Verify field names are unique
  • Ensure valid data types are selected

API Integration Problems

  • Confirm template ID is correct
  • Check API key permissions
  • Verify document format compatibility

Field Configuration Errors

  • Review field type selections
  • Check nested field structures
  • Validate array item types

Getting Help

  • Use the Guide button in the template editor for contextual help
  • Review template examples in the marketplace
  • Check the API documentation for integration details
  • Contact support for complex template requirements

Next Steps

Templates are the foundation of successful document processing with Parselyze. Take time to design them thoughtfully for the best results.