# Lookups

Source: https://www.digiparser.com/docs/guides/post-processing/lookup-tables

Post Processing

# Lookups

Match and enrich extracted data with CSV files or parser data

Copy MarkdownOpen

# [Lookups](#lookups)

Feedback

Lookups let you match extracted values against a reference source and save a result in another parser field. A lookup source can be:

Feedback

*   A **CSV file** you upload
*   **Parser data** from completed documents in the same workspace

Feedback

You can use lookups to add IDs and dates, count matching records, calculate totals, or flag documents that may need review.

## [How lookup rules work](#how-lookup-rules-work)

Feedback

Every rule has three parts:

Feedback

1.  **Lookup source** - Choose a CSV file or parser data.
2.  **Matching conditions** - Match one or more fields from the current document to fields in the source. All conditions must match the same source row.
3.  **Result** - Choose what DigiParser should return and which current-parser field should receive it.

Feedback

Rules run from top to bottom before Custom Code. A later rule can use a value created by an earlier rule.

## [Create a lookup rule](#create-a-lookup-rule)

Feedback

1.  Open your parser and go to **Settings -> Post Processing -> Lookups**.
2.  Open **Lookup Rules**.
3.  Click **Add Lookup Rule**.
4.  Choose a source type:
    *   **CSV file** - Select a file uploaded under **CSV Files**.
    *   **Parser data** - Select a parser and then choose **Document fields** or one of its tables.
5.  Add one or more matching conditions.
6.  Choose the result action and the field where the result should be saved.
7.  Review the rule summary and click **Add Rule**.

Feedback

Lookup Rules are always available. You do not need to upload a CSV file before creating a rule that uses parser data.

app.digiparser.com![Add Lookup Rule showing CSV file and Parser data source options](https://documents.digiparser.com/docs/screenshots/2026-07-24/lookup-source-options.png?sig=8a148dd7f3cdcd4eab247b2d609ff9dea108af65a660665dd7561b3f8c36427f)

## [CSV file sources](#csv-file-sources)

Feedback

Use a CSV source for reference data that you maintain outside DigiParser.

Feedback

To upload one:

Feedback

1.  Open **Post Processing -> Lookups -> CSV Files**.
2.  Click **Upload CSV File**.
3.  Select a `.csv` file.
4.  Return to **Lookup Rules** and select that file as the lookup source.

Feedback

CSV sources support:

Feedback

*   **Exact matching** - Values must be the same; capitalization and extra spaces are ignored.
*   **Fuzzy matching** - Allows small spelling differences and typos.

Feedback

Replacing a CSV file updates the source used by every rule that references that file.

## [Parser data sources](#parser-data-sources)

Feedback

Use a parser source when the reference information already exists in DigiParser.

Feedback

After choosing **Parser data**, select:

Feedback

1.  The source parser.
2.  The source dataset.

Feedback

Two dataset types are available:

Feedback

*   **Document fields** - Each completed source document is one lookup row. Use this for fields such as vendor, purchase-order number, employee name, date, or total.
*   **A table** - Each row of the selected source table is one lookup row. Only columns from that table are available.

app.digiparser.com![Parser data lookup showing the source parser, dataset, and matching conditions](https://documents.digiparser.com/docs/screenshots/2026-07-24/parser-data-lookup.png?sig=9dc9a63618da55848103f6241c64e7ba97e07d6f066acf3f8853c1bf7fdac4e4)

Feedback

Parser sources use exact matching in the first version. Capitalization and extra spaces are ignored.

Feedback

Only completed, non-deleted, successful documents are searched. The document currently being processed is excluded, so a parser can safely look up its own previous documents. Archived documents remain eligible.

Feedback

Parser sources are live. New documents and edits can affect future lookups. Previously processed documents are not changed automatically; reprocess a document when you want to recalculate its lookup results.

Feedback

Documents that are still processing are not searched. If identical documents finish at nearly the same time, reprocess one of them to recalculate a possible-duplicate count.

## [Current document fields and tables](#current-document-fields-and-tables)

Feedback

The field receiving the result controls how often the rule runs:

Feedback

*   If the result is saved to a **document field**, the rule runs once per document.
*   If the result is saved to a **table column**, the rule runs once for each row of that current-document table.

Feedback

For a table result, matching conditions can use:

Feedback

*   Document fields, which stay the same for every row
*   Columns from the same current-document table

## [Result actions](#result-actions)

Feedback

Choose one of these actions:

Feedback

*   **Copy first matching value** - Uses the newest matching source document. For a source table, the first table-row match in that document is used.
*   **Count matching rows** - Counts matching documents for a Document fields source or matching table rows for a table source.
*   **Sum** - Adds numeric values from all matching rows.
*   **Average** - Calculates the average of numeric values from all matching rows.
*   **Minimum** - Uses the smallest matching numeric value.
*   **Maximum** - Uses the largest matching numeric value.
*   **Comma separated** - Combines values from every matching row.

Feedback

Count does not require you to choose a source value. Other actions require the source field that should be returned or calculated.

## [Example: add a purchase-order date to an invoice](#example-add-a-purchase-order-date-to-an-invoice)

Feedback

Suppose an invoice contains a purchase-order number, while the purchase-order date is stored in a Purchase Orders parser.

Feedback

1.  In the Invoice parser, add an output field named `Purchase Order Date`.
2.  Create a lookup rule and choose **Parser data**.
3.  Select the **Purchase Orders** parser.
4.  Select **Document fields**.
5.  Match the invoice's `Purchase Order Number` to the source `Purchase Order Number`.
6.  Choose **Copy first matching value**.
7.  Use the source field `Purchase Order Date`.
8.  Save the result to the invoice's `Purchase Order Date` field.

## [Example: flag a possible duplicate pay stub](#example-flag-a-possible-duplicate-pay-stub)

Feedback

Suppose a pay stub should be reviewed when an earlier document has the same employee, pay period, and net pay.

Feedback

1.  Add a number field named `Possible Duplicate Matches`.
2.  Create a lookup rule and choose **Parser data**.
3.  Select the current Payroll parser and **Document fields**.
4.  Add these matching conditions:
    *   Employee Name = Employee Name
    *   Pay Period = Pay Period
    *   Net Pay = Net Pay
5.  Choose **Count matching rows**.
6.  Save the result to `Possible Duplicate Matches`.

Feedback

To turn the result into an alert, add a review stage whose numeric condition is:

Feedback

`Possible Duplicate Matches` **is greater than** `0`

Feedback

DigiParser can then assign the document for review and use the existing reviewer notification settings.

Feedback

This is a possible-duplicate indicator, not a guarantee that two files are identical. It deliberately uses the fields you choose.

## [Missing sources and fields](#missing-sources-and-fields)

Feedback

If a selected parser, table, or field is removed, the rule is marked **Needs attention** in Lookup Rules. DigiParser skips that rule and continues the remaining workflow instead of failing the document.

## [Tips](#tips)

Feedback

*   Use stable identifiers such as invoice number, purchase-order number, employee ID, or account number whenever possible.
*   Add several conditions when one field is not unique.
*   Use **Count matching rows** when you only need to know how many records exist.
*   Test important rules with a sample value before relying on them in a workflow.
*   Reprocess a document after changing source data when you want its result refreshed.

## [Next steps](#next-steps)

Feedback

*   [Clean and Format Data](/docs/guides/post-processing/data-transformations)
*   [Custom Code](/docs/guides/post-processing/custom-code)

How is this guide?

GoodBad

[

Clean and Format Data

Use Ask AI or Custom Code to clean and format extracted values

](/docs/guides/post-processing/data-transformations)[

Custom Code

Write custom code to transform your extracted data

](/docs/guides/post-processing/custom-code)