Skip to main content
When processing an invoice, ABBYY FlexiCapture first looks for the vendor (the company that issued the invoice) and the business unit (the company or department that received the invoice). In most cases, the vendor determines the language of the invoice and the formatting of its numbers, dates, and amounts. The business unit determines the tax rates and applicable regulatory requirements. ABBYY FlexiCapture uses all of this information when capturing invoice data and applying validation rules. To help the program locate the vendor and business unit fields, you can use vendor and business unit databases. These must be connected to the data sets in your Document Definition. A data set is a local copy of a table from an external database that stores information about vendors or business units. Its values can be typified and normalized, and it can be periodically updated to stay synchronized with its external database. For more information, see Preparing vendor and business unit databases. Vendor and business unit databases can also be used for automatic and manual data checks. You do not have to use vendor and business unit databases. Whether you use them affects company detection and field training:

Connect a vendor or business unit database

You connect vendor and business unit databases the same way.
1

Open the Document Definitions dialog box

Open the Project menu and click Document Definitions….
2

Edit the Document Definition

Click the Edit… button in the dialog box that opens.
3

Open the Document Definition properties

Open the Document Definition menu and click Document Definition Properties….
4

Open the Data Sets tab

Open the Data Sets tab in the dialog box that opens.
5

Open the data set

Double-click the BusinessUnits (or Vendors) row, or click the Set Up… button. The Data Set dialog box opens.A data set is essentially a table of data with a fixed set of columns and types that you cannot change. You match each data set column with a column from an external database. If a database does not contain a table with the necessary data, create a view with this data and specify the view as the table.
6

Select the source

Select Database from the Source drop-down list. Select the Script source type only if you plan to use a script to update the data set. For more information, see Updating data sets.
7

Specify the connection string

Specify the database connection string. You can select one of the existing environment variables from the project or define a new string by clicking the Specify… button. Using an environment variable from the project lets you move the project and connect to databases with the same structure without editing the Document Definition.
8

Select the schema and table

Select the Data schema and Database table.
9

Match the columns

Match the columns from the data set with their corresponding columns in the external database. For each data set column, you can specify the corresponding external database column or a value.The Match fields list contains:
  • The names of columns in the data set.
  • The corresponding columns from the external database.
  • The Found column, which contains a checkmark when a match between the data set field and a database column has been established.
  • The Normalization column, which shows the type of normalization used for the value.
By default, each field in the External Database column of the data set contains the value, which means that no external database column has been specified. Normalization makes it possible to treat several slightly different values as identical. For more information, see Normalization of values in data sets.To map each column, select it in the table and click the Edit… button. For more information, see Map a data set column to a database column.
10

Add custom columns (optional)

Use the Add… button to add custom columns to a data set and specify corresponding columns in an external database. Use the Edit… and Delete buttons to manage complex columns. Predefined columns (indicated by the lock icon) cannot be deleted.
11

Set an update period

Specify a database update period in the data set if automatic updates are required.
12

Enable script validation (optional)

To validate records using a script, enable the Check records using scripts option. For more information, see Data set validation scripts.
13

Save your changes

Save your changes.

Map a data set column to a database column

1

Open the column mapping

In the Match fields list, select the column and click the Edit… button. The Data Set Column Mapping dialog box opens.
2

Select the database column

Select the matching database column from the Database columns list.If your database has no matching column for a data set column, refer to the Vendors data set and BusinessUnits data set sections.
3

Set up multiple values (optional)

Invoices from the same vendor can contain different company names and addresses. When several values correspond to the same vendor (the same VATID), place them in different columns of the external database table or view, such as Name1, Name2, Address1, …, AddressN. You can then select Several columns… from the list and specify any number of database columns as matches for the data set column.The external database may contain only one value for the company name or street, but these fields can have several common variants on invoices. For the best detection quality, the text in these fields on an invoice should be as close as possible to the corresponding text in the data set. For more information, see Multiple-value columns in a data set.To create more than one column, specify the number of permitted columns for a field in the Max variant count box. Operators can add values to these columns later. If you specify a number that is less than the actual number of columns, it is increased automatically when the data set is updated. If you specify a number greater than the actual number of columns, empty columns are added.
4

Select the normalization type

Select an entry from the Normalization list that best fits the type of data in the column. For more information, see Normalization of values in data sets. If necessary, enable the Store normalized value option.
5

Set the Cannot be empty option

Enable the Cannot be empty option if necessary. This option tells the program that a column has to contain values. If the column contains no values, the record is marked as invalid.Cannot be empty is enabled by default for the BusinessUnitId column when both of the following are true: your Document Definition contains a Vendors data set that uses an external database as its source, and the value of the Vendor field depends on the value of the Business Unit field. If the Vendors data set uses another source, enable this option manually.
6

Save the mapping

Save the changes in the Data Set Column Mapping dialog box.

The Data Sets tab

All data sets are listed on the Data Sets tab, with the following columns: You can manage the data sets using the buttons to the right of the list: The Vendors and BusinessUnits data sets are stored within the project and must be synchronized with an external database, whose data may change over time. Synchronization occurs when the project is opened, but only if the time elapsed since the previous synchronization exceeds the specified update period. For more information, see Updating data sets.

View and edit data set records

To view or edit a data set, select it on the Data Sets tab of the Document Definition properties dialog box and click the View… button. All records belong to one of three record groups. You can select the record group you want to view from the Record group drop-down list. Click the Set… button to sort and filter records by their values in one of the list’s columns. The Reset button disables the filter. To apply sorting and filtering to newly added or edited records, set the filter again. Different operations are available for each of the record groups: * Adding and editing records is only possible if the Primary key option is enabled. Records in the PurchaseOrders and PurchaseOrderItems default data sets cannot be added or edited. When adding or editing records, the number of values you can specify for a field cannot exceed the Max variant count set for that field in the Data Set Column Mapping dialog box. You can use the Add button and Remove button buttons in the Add Record and Edit Record dialog boxes to manage records.

Database Check rules

The Invoice Document Definition contains rules that are used to check data in the Vendor and Business Unit groups of fields against the database. These are standard rules of the Database Check type, named (Rejected) Vendor should be found in the database and (Rejected) Business Unit should be found in the database. To learn how to find rules in the list, see Rules. You can view the properties of these rules to find out how each field in the Vendor and Business Unit groups is checked:
  • Which fields must exactly match records in the data set (and, by extension, in the database).
  • Which fields do not have to match perfectly.
  • Which fields are simply copied from the database.
You can also specify a field to be used as a primary key for selecting a record from the data set. For more information, see Database Check rule. Database Check rules are applied automatically when the invoice is recognized, and then each time an Operator changes fields in the group during verification.

Look up records while processing invoices

If a vendor or a business unit has not been determined automatically, the Operator can select the appropriate record from the database (the data set). For more information, see Looking up vendors and business units in the database.

Modify and add vendor and business unit records

You can allow Operators to add new vendor and business unit records (if they are not found in the database) to data sets during verification and edit existing entries. This data is not stored in external vendor and business unit databases, but it is used during invoice processing and rule checks. For more information, see Enabling additional program features for operators. For more information about database lookups, see Looking up vendors and business units in the database.