> ## 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 purchase orders

> Connect the BusinessUnits, Variants, and Articles data sets to an external database to improve buyer and vendor detection in an Orders project.

When using an external database, you can use data sets with the Order Document Definition to detect buyer and vendor company details. 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 Order Document Definition:

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

<Note>
  Currently, you cannot check article numbers against a database directly. You can, however, check if your database contains article numbers detected by using neural networks and a FlexiLayout. For more information about detecting the main fields, see [Detecting the main fields](/flexi-capture/invoice-reader/ir-search-fields).
</Note>

## Connect a data set to a database

<Steps>
  <Step title="Open the Order Document Definition properties">
    In the Document Definition Editor, open the properties of the Order 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>
