Automating line items

Configure line item automation using confidence score thresholds, minimum occurrence settings, and custom validation rules to achieve higher automation rates.

When trying to automate the processing of line items, Rossum offers configurations that can get you to a good automation rate. This article teaches you how to set up Rossum to meet your needs and reach a reasonable level of line item automation.

Confidence score for line items

Previous articles introduced Confident Automation. Confidence scores are part of Confident Automation and are returned for header field values and line items captured on the document. For more information, see Using AI confidence thresholds for automation in Rossum.

Automate line items at all times

To automate line items at all times, set the confidence score on all columns in the line items to 0 in the schema editor. Although confidence scores are not currently returned, setting a zero confidence score threshold lets Rossum be more permissive when automating line items. The effects of setting a non-zero threshold are described later in this article.

"score_threshold": 0

This approach stops only values that:

  1. Cannot be parsed because of a number or date formatting error.
  2. Were evaluated with a negative check.
Figure 1. Example of a parsing error that stops automation.

The validation sources of the fields contain a score value when the value is empty, or checks when any of the built-in checks are satisfied.

Learn how to debug the validation sources of specific fields through the API.

Automate only documents which have at least one line item

A common use case is to automate only documents that contain at least one line item. You can achieve this by setting the following attribute on the multivalue object representing the line items:

"min_occurrences": 1
Figure 2. Setting the minimum occurrence in the schema.

Automate numeric columns that are either empty or pass a built-in check

To be more strict about automated columns, you can set a non-zero threshold for some columns.

For example, consider a document on which the Total amount column is captured but the total amount in one line item is computed incorrectly. The column cannot be validated against the Total amount in the header fields, and the line item calculation using quantity and unit price is also unequal, as described in the built-in checks that Rossum performs.

Figure 3. Line items with an incorrect value.

When analyzing the validation sources as described in Confident Automation in practice, you would see that the Total amount field in the first line item does not contain a checks or score validation source.

See an example document.

To stop such documents from being automated, set any non-zero score threshold on the fields, such as:

"score_threshold": 0.9

This stops the automation of columns that have a value but were not validated by any built-in check.

Automate only line items that have non-null description

Another common use case is to automate only documents in which every line item has a non-null value for a specific field. For example, item descriptions can be used later to match purchase order line items, so they must always contain a value.

For this purpose, Rossum has created a custom check listed among the built-in checks that can be enabled on your account. Contact support@rossum.ai. We will ask you additional questions or inform your direct Rossum contact.

You can also make the field required so users cannot confirm a document whose line items are missing required fields.

Automate line items with description where at least one column is validated against a header field

The most advanced setup currently available applies these rules:

  • The line item description must be non-null.
  • At least one monetary column must equal the total amount on the document.
  • If either condition is not fulfilled, the document is not automated.

This approach prevents the automation of line items when no monetary columns were captured, because at least one is required, or when none of the monetary columns appears to have been captured correctly.

At least one of the following monetary rules must apply:

  • The sum of the Total amount column equals the Total amount header field. The fields use the table_column_amount_total and amount_total rir_field_names.
  • The sum of the Total amount base column equals the Total amount base header field. The fields use the table_column_amount_total_base and amount_total_base rir_field_names.
  • The sum of the Unit price column equals the Total amount header field, while the expected quantity is 1 for all line items. The fields use the table_column_amount and amount_total rir_field_names.
  • The sum of the Unit price without tax column equals the Total amount base header field, while the expected quantity is 1 for all line items. The fields use the table_column_amount_base and amount_total_base rir_field_names.

To enable this configuration, contact support@rossum.ai or your direct Rossum contact.

Implementing custom configurations

If the configurations described above cannot be applied to your setup, you can implement your own webhook or custom function, which can access captured values immediately after Rossum finishes the initial extraction.

Based on your custom rules, you can populate the validation sources of the fields and enforce the automation of the document before it is shown to users for review on the document dashboard.