Inline validators
Inline validators enable you to create field-level validation rules directly within DocAI Studio without creating reusable business rule validators in Tungsten TotalAgility Advanced Studio. Inline validators are self-contained, non-reusable rules that are stored as part of the extraction group.
Two types of inline validators are available:
- Single-field validators:
-
A single-field inline validator validates an individual field. The validator is applied to the field through the field properties and can reference other fields, field properties, document properties, and functions in its condition expression. When the validator fails, only the field on which it is defined is marked invalid.
For example, you can create a single-field validator to ensure that a customer ID is 12 characters long and contains only numbers.
- Multi-field validators:
-
A multi-field inline validator validates relationships between multiple fields. The validator is applied at the document type level and requires a minimum of two input fields. When the validator fails, all input fields are marked invalid.
For example, you can create a multi-field validator to ensure that the due date is greater than or equal to the invoice date.
Inline validators execute during the following operations:
-
Field extraction for training documents
-
Manual entry of field values during scan
-
Automatic extraction from documents
-
Validation when confirming updates to the field
Validators always execute after formatters. If a formatter fails, validation is skipped for that field. This execution order is important to understand when troubleshooting validation issues.
When multiple validators are applied to a field, they execute in the order displayed in the validation rule list. A validator executes only if all preceding validators have passed.
Refer to https://learn.microsoft.com/en-us/dotnet/standard/base-types/formatting-types for more information about the syntax required for validation condition rules.
When to use inline validators
Use inline validators when you need simple, field-specific validation logic that does not need to be shared across multiple fields or solutions. Inline validators are ideal for:
-
Validating that field values meet specific criteria
-
Validating relationships between multiple fields
-
Applying validation rules that are unique to a specific field or document type
For Standard-tier users, inline validators provide the only way to create custom validation rules beyond regular expression and date validation without access to Tungsten TotalAgility Advanced Studio. Advanced and Enterprise-tier users can use either inline validators or business rule validators, depending on whether the validation logic needs to be reusable.
Note the following limitations when working with inline validators:
-
Validators are not supported for bar code fields.
-
Table fields cannot be added as inputs to multi-field validators.
-
Validation is disabled for all tables in predefined document types.
-
Inline validators are non-reusable and cannot be applied to other fields or document types.
Field deletion protection
Fields that are referenced by inline validators cannot be deleted. If you attempt to delete a field that is used as an input to an inline validator or is referenced in an inline validator condition, the deletion is blocked, and the system displays a message identifying the inline validator that references the field.
To delete a field that is referenced by an inline validator, you must first delete or modify the inline validator to remove the field reference.
When you rename a field that is referenced by an inline validator, the system automatically updates the reference without breaking the validator.