Skip to main content
Validations allow you to enforce rules on extracted data to ensure quality and consistency. TableFlow supports various validation types that can be applied to both template fields and table columns. Any data that fails validation will be flagged in the review interface, allowing for manual correction before further processing.

How Validations Work

Validations are defined as an array on template fields or table columns:
Each validation has the following properties:
  • validate (required): The type of validation rule
  • options: Additional configuration for the validation rule (varies by type)
  • message: Custom error message to display on validation failure
  • severity: The severity level of the validation failure (“error”, “warn”, or “info”)

Validation Types

Universal Validations

These validations can be applied to any data type.

Not Blank

Ensures that the field or cell contains a non-blank value.

String Validations

These validations can only be applied to string data types.

List

Ensures the value matches one of the items in a predefined list. Comparisons are case-insensitive.

Email

Ensures the value is a valid email address.

Phone

Ensures the value is a valid phone number.

Length

Validates the length of text content.
You can specify only min or max:

Regex

Ensures the value matches a specific regular expression pattern.

Number Validations

These validations can only be applied to number data types.

Range

Validates that the number falls within a specific range.
You can specify only min or max:

Decimal

Validates the number of decimal places.

Date Validations

These validations can only be applied to date data types.

Date Range

Validates that a date falls within a specific range.

Validation Severity Levels

TableFlow supports three severity levels for validations:
  • error: Prevents extraction data from being used until fixed
  • warning: Allows data to be used but indicates potential issues
  • info: Provides informational feedback without blocking

Combining Multiple Validations

You can apply multiple validation rules to the same field or column. All validations must pass for the data to be considered valid.

How Validations Affect Extraction

During the document extraction process:
  1. Data is extracted from the document based on the template
  2. Each extracted value is checked against applicable validations
  3. Values that fail validation are flagged for review
  4. The review interface highlights validation errors with their messages
  5. Users can correct the data before finalizing the extraction

Example Validation Scenarios

Invoice Number Validation

Amount Validation

Best Practices

For optimal validation results:
  1. Start Simple - Begin with basic validations and add complexity as needed
  2. Use Clear Messages - Write clear, descriptive validation messages
  3. Combine Validations - Use multiple validation types for complex rules
  4. Set Appropriate Severity - Use error for critical validations, warnings for less critical issues
  5. Test Thoroughly - Verify validations work with real-world documents

Next Steps

Learn how to use webhooks to integrate extracted data with your application.