> ## 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.

# Use data sets to improve detection for commercial invoices

> Connect the Variants and BusinessUnits data sets to an external database to improve vendor and consignee detection on commercial invoices in FlexiCapture.

When using an external database, you can use data sets with the Commercial Invoice Document Definition to detect company details for the vendor and consignee. Before you can use a data set, you need to connect it to your external database. For more information, see [Using vendor and business unit databases](/flexi-capture/invoice-reader/ir-db-connection).

You can use the following data sets with the Commercial Invoice Document Definition:

| **Data set**      | **Description**                                                            |
| ----------------- | -------------------------------------------------------------------------- |
| **Variants**      | A data set for detecting document issuers when using an external database. |
| **BusinessUnits** | A data set for detecting business units when using an external database.   |

## Connect a data set to a database

<Steps>
  <Step title="Open the Commercial Invoice Document Definition properties">
    In the Document Definition Editor, open the properties of the Commercial Invoice Document Definition.
  </Step>

  <Step title="Set up the data set">
    Click the **Data Sets** tab, select the desired data set, and click **Set Up...**.
  </Step>

  <Step title="Configure the connection">
    In the **Data Set** dialog box, provide the connection string to be used to connect to your external database and configure the columns, search options, refresh period, and other settings.
  </Step>
</Steps>
