Validations
Ensure data quality with validation rules
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”, “warning”, 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.
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:
- Data is extracted from the document based on the template
- Each extracted value is checked against applicable validations
- Values that fail validation are flagged for review
- The review interface highlights validation errors with their messages
- Users can correct the data before finalizing the extraction
Example Validation Scenarios
Invoice Number Validation
Amount Validation
Best Practices
For optimal validation results:
- Start Simple - Begin with basic validations and add complexity as needed
- Use Clear Messages - Write clear, descriptive validation messages
- Combine Validations - Use multiple validation types for complex rules
- Set Appropriate Severity - Use error for critical validations, warnings for less critical issues
- Test Thoroughly - Verify validations work with real-world documents
Next Steps
Learn how to use webhooks to integrate extracted data with your application.