> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Rule verification

> Use rules to validate, modify, or compute field values in a Document skill. Covers built-in rules, execution order, and using rules with tables.

Rules let you automatically verify extracted data against conditions you define, modify field values (for example, sum several fields), and route failing documents to manual review.

## How rules work

A rule that references only repeating fields from the same group (such as a table) becomes a **repeating rule** — it runs once per instance (first instance, then second, and so on). This is how rules process table rows.

Documents with fields that fail one or more rules are sent to manual review. If an operator changes a field value during review, the applicable rules run again. When only one instance of a repeating field changes (for example, a single table cell), the repeating rule re-runs only for the modified instance.

### Execution order

Vantage runs rules in a predefined order:

* Rules that **read** a field run after rules that **write** that field.
* Chained dependencies run sequentially — if rule A writes field X (which rule B reads) and rule B writes field Y, A runs before B.
* When multiple rules write to the same field, they run in creation order.
* Circular dependencies — where rule A reads X and writes Y while rule B reads Y and writes X — cause an error.

## Create a rule

To add a field verification rule:

<Steps>
  <Step title="Click New rule">In the field properties, click **New rule**.</Step>
  <Step title="Name and configure the rule">In the dialog, give the rule a name and select the fields it should check from the dropdown.</Step>
</Steps>

To create a custom rule using a script, see [Business rules automation](/vantage/documentation/skill-designer/document/rule-verification/business-rules-automation).

## Built-in rules

| Rule                    | What it does                                                                                                                                                                          | Applies to    |
| :---------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------ |
| **Check Sum**           | Adds the values of several fields and compares the result to another field.                                                                                                           | Number, Money |
| **Check Product**       | Multiplies the values of several fields and compares the result to another field.                                                                                                     | Number, Money |
| **Compare**             | Compares the values of several fields.                                                                                                                                                | Any           |
| **Merge**               | Merges the values of several fields into a target field (the target field must already exist). You can add separators from the provided list.                                         | Any           |
| **Data Catalog Lookup** | Checks field values against records in a data catalog. See [Create data catalog lookup rules](/vantage/documentation/skill-designer/document/rule-verification/setting-lookup-rules). | Any           |

## Use rules with tables

All built-in and custom rules can be applied to table cells by specifying a column as a field. The rule then runs against every cell in that column. A single rule can reference both table columns and fields outside the table.

The **Check Sum** and **Check Product** rules support three common table patterns:

### Compare a column total with an external field

Sum (or multiply) every cell across one or more columns and compare the result to a single field outside the table.

* In **Add Up Fields** or **Fields to Multiply**, choose the columns. You can mix columns from different tables. A single column also works.
* In **Compare Sum with** or **Compare Product with**, choose the external field. All cells in the selected columns are combined once and compared to that field.

### Compare two columns row-by-row

When both the input and comparison fields are columns from the same table, the rule becomes a repeating rule that runs once per row. For example, multiply the unit price column by the units-ordered column and compare to the line-total column to verify each row's math.

### Compare a column with another column plus a constant external field

Pass a table column and a field outside the table as inputs, and a column from the same table as the comparison. The rule runs once per row, using the external field as a constant in every row.

## Related topics

* [Business rules automation](/vantage/documentation/skill-designer/document/rule-verification/business-rules-automation)
* [Create data catalog lookup rules](/vantage/documentation/skill-designer/document/rule-verification/setting-lookup-rules)
* [Add fields](/vantage/documentation/skill-designer/document/adding-fields/adding-fields)
