PARSER GUIDES
Lookups
Post Processing
Match and enrich extracted data with CSV files or parser data
Lookups let you match extracted values against a reference source and save a result in another parser field. A lookup source can be:
- A CSV file you upload
- Parser data from completed documents in the same workspace
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
Every rule has three parts:
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 PARSER should return and which current-parser field should receive it.
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
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.
Lookup Rules are always available. You do not need to upload a CSV file before creating a rule that uses parser data.
guide-guides-post-processing-lookup-tables-01-lookup-source-options.webpRequired PARSER view: Add Lookup Rule showing CSV file and Parser data source optionsFuture alt text: Add Lookup Rule showing CSV file and Parser data source optionsCSV file sources
Use a CSV source for reference data that you maintain outside PARSER.
To upload one:
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.
CSV sources support:
- Exact matching - Values must be the same; capitalization and extra spaces are ignored.
- Fuzzy matching - Allows small spelling differences and typos.
Replacing a CSV file updates the source used by every rule that references that file.
Parser data sources
Use a parser source when the reference information already exists in PARSER.
After choosing Parser data, select:
1. The source parser.
2. The source dataset.
Two dataset types are available:
- 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.
guide-guides-post-processing-lookup-tables-02-parser-data-lookup.webpRequired PARSER view: Parser data lookup showing the source parser, dataset, and matching conditionsFuture alt text: Parser data lookup showing the source parser, dataset, and matching conditionsParser sources use exact matching in the first version. Capitalization and extra spaces are ignored.
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.
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.
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
The field receiving the result controls how often the rule runs:
- 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.
For a table result, matching conditions can use:
- Document fields, which stay the same for every row
- Columns from the same current-document table
Result actions
Choose one of these actions:
- 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.
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
Suppose an invoice contains a purchase-order number, while the purchase-order date is stored in a Purchase Orders parser.
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
Suppose a pay stub should be reviewed when an earlier document has the same employee, pay period, and net pay.
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.
To turn the result into an alert, add a review stage whose numeric condition is:
Possible Duplicate Matches is greater than 0
PARSER can then assign the document for review and use the existing reviewer notification settings.
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
If a selected parser, table, or field is removed, the rule is marked Needs attention in Lookup Rules. PARSER skips that rule and continues the remaining workflow instead of failing the document.
Tips
- 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.