Document Automation validation rules: conditions and actions - Document Automation validation rules help you flag errors and warnings, clean up extracted values, and validate formulas across fields. Review available field rules, document rules, conditions, actions, and examples.

Automation 360

Document Automation validation rules help you flag errors and warnings, clean up extracted values, and validate formulas across fields. Review available field rules, document rules, conditions, actions, and examples.

Overview

Use validation rules to define conditions, such as pattern matching or equality checks. When the conditions are met, validation rules can flag errors or warnings, clean up values, replace values, or set new values.

Validation rules can be applied at the following levels:
  • Field rules
  • Document rules

Field rules

Field rules apply to individual fields. A field rule contains a condition and a set of actions to perform when the condition is met.

Field rule configuration for a selected document field

Field rules are processed before document rules.

Document rules

A document rule is associated with a field and can include conditions and actions that depend on values from other fields. Use document rules to define validation logic that compares multiple extracted values.

Document rule configuration with conditions and action fields
Note:
  • You can select one or more fields where these actions can be applied.
  • Document rules can include dependencies between fields. Maintain the required execution sequence.
  • If you are using formula validation in document rules, ensure that all the fields used in the formula of the condition are also included in the action fields.
  • You must enter all the populated fields while adding a field or document rule to get the Update option enabled.

    For example, you must add an Action value for selected Action type and then update the learning instance.

Watch the following video to see how to use field-level and document-level validation rules to improve data extraction.

Video demonstrates using field-level and document-level rules for validation.

Field references in validation rules

You can use field references in field and document rules to compare extracted values across form fields and table fields, copy values between fields, and include field values in error or warning messages. Use the field picker in supported condition rule value and action type fields to select the required form or table field references.

Field reference is available for the following condition types:
  • equal to
  • not equal to
  • contains
  • doesn't contain
  • starts with
  • doesn't start with
  • ends with
  • doesn't end with
Field reference is available for the following action types:
  • set value
  • show error
  • show warning
  • replace
Note:
  • Field and table field names cannot contain double curly brackets {{ or }} in the names and values.
  • Reference to table fields from form fields is not supported.
  • Reference to table fields from another table field is not supported.

Available conditions

A condition is a logical rule that evaluates whether field data meets a defined requirement.

List of available validation conditions in Document Automation

Action type Description
equal to Validates whether data in a field is equal to a certain value.
not equal to Validates whether data in a field is not equal to a certain value.
contains Validates whether data in a field contains a certain value.
doesn't contain Validates whether data in a field does not contain a certain value.
starts with Validates whether data in a field starts with a certain value.
doesn't start with Validates whether data in a field does not start with a certain value.
ends with Validates whether data in a field ends with a certain value.
doesn't end with Validates whether data in a field does not end with a certain value.
is empty Validates whether data in a field is empty.
is not empty Validates whether data in a field is not empty.
does match regex Validates whether data matches the defined regular expression. See Validation regex patterns in Document Automation.
does not match regex Validates whether data does not match the defined regular expression. See Validation regex patterns in Document Automation.
does match formula Validates whether data matches the defined formula. See Formula validation.
Note: This action type is available only for Number data type.
does not match formula Validates whether data does not match the defined formula. See Formula validation.
Note: This action type is available only for Number data type.
is in list Validates whether data is part of a list.
Note: This action type is only available for Text and Address data types.
is not in list Validates whether data is not part of a list.
Note: This action type is only available for Text and Address data types.

Available actions

An action is an operation that runs when the specified conditions are met. Actions filter generated output and provide more accurate document data.

List of available validation actions in Document Automation

Action type Description Example
set value If the specified condition is met, the set value action sets the specified value for the selected fields.

Set value action

clear value If the specified condition is met, the clear value action clears the values of the selected fields.

Clear value action

show error If the specified condition is met, the show error action shows the error message for the selected fields.

Show error action

show warning If the specified condition is met, the show warning action shows the warning message for the selected fields.

Show warning action

replace If the specified condition is met, the replace action replaces the values of the selected fields.

Replace action

regex extract If the specified condition is met, the regex extract action applies a regular expression to the extracted value to retrieve a specific sub-string. If the specified condition is not met, then an empty string is returned. See Validation regex patterns in Document Automation.
Note: The regex extract action extracts only the first match found in the value based on the specified regex pattern.

Regex action

Examples

The following examples show how validation rules can improve data extraction results.

Note: Modify the regular expressions in these examples for your requirements.
Use case Condition Condition value Action Action values
Replace a character

Replace the letter l in extracted data with the number 1 when the extracted data contains only numbers.

contains l replace
  • Find what: l
  • Replace with: 1
Remove spaces

Extract only the numbers in Total: $100.

does match regex [\s\S]+ replace
  • Find what: . Enter space.
  • Replace with: . Leave this field empty.
Remove characters from string

You can use validation rules to remove characters from extracted data. For example, you could extract only the numbers in "Total: $100".

does match regex [\s\S]+ regex extract \d+
Use formula validation to validate calculation

Check values that involve calculations. For example, validate the total amount by adding the subtotal, sales tax, shipping and handling, and sales shipping. You can also validate the subtotal by subtracting sales tax, shipping and handling, and sales shipping from the total amount.

  • doesn't match formula

    Operator: And

  • doesn't match formula
Note: We have used two conditions in this example. The first condition checks if the total amount is correct and the second one checks the subtotal amount.
  • total_amount == SUM(subtotal, tax_amount, shipping_handling, sales_shipping)
  • subtotal == SUB(total_amount, tax_amount, shipping_handling, sales_shipping)
show error Incorrect total amount or subtotal. Please validate.
Use signature detection to validate signatures in documents

Check whether a signature is detected, not detected, or not found. For example, validate signatures in banking services before processing cheques or know your customer (KYC) documents.

equal to signature not detected show error NA