Reconcile two documents or lists
This guide is for authors who need two sources to agree before work goes on: an invoice and a packing list, a purchase order and a delivery note, or a statement and your own records. The Checklist block compares them, reports every difference, and can ask a person about only those differences.
1. Get both lists into the run
Section titled “1. Get both lists into the run”A list comparison reads a list of records or a table with known columns from an earlier block. To read them from documents, use AI Agent with Answer format set to JSON and an Answer shape that holds both lists. See Read data from a document.
2. Add a check that compares two lists
Section titled “2. Add a check that compares two lists”Add Checklist and click Add check. Give the check a Label, then under Comparison choose Compare two lists, row by row. For each list:
- Name it, such as “Commercial invoice” and “Packing list”. The reviewer sees these names.
- Under Rows, pick the list. Use Observed list for the document you are checking and Expected list for what it should agree with.
A Checklist holds up to 100 checks, at most 5 of them comparing lists. Add single-value checks beside it, such as the invoice number printed on both documents.
3. Choose the keys
Section titled “3. Choose the keys”The key says which rows belong together, such as the SKU. Rows pair up when their key columns are equal.
Lainstack suggests a key when both lists have a column with the same name. Use Add key column when one column isn’t enough, up to 3, such as an order number and a line number.
- Keys ignore letter case and spaces at either end.
- A blank key or a repeated key is always a finding, and rows with a repeated key are never paired. Choose columns that are unique in each list.
4. Decide about rows in only one list
Section titled “4. Decide about rows in only one list”For each list, A row in … with no match in … is either:
- a finding: a row in only this list needs attention. Use this when every line must appear on both documents.
- a note: the row is shown but doesn’t need attention. Use this when one list is meant to be longer, such as a catalogue compared with an order.
5. Compare the columns
Section titled “5. Compare the columns”Click Suggest columns to compare columns both lists name alike, or Add column comparison to choose your own, up to 20. With no columns, the check only tells you whether each key is in both lists.
For each column, choose the Comparison. Depending on the type of the column, you can also set:
- Tolerance, for equality on numbers and dates: within a set amount or a percentage, or within a number of days. A difference inside it counts as a match, so a count one unit out needn’t stop anyone.
- Match case and Trim whitespace, for text.
Custom JavaScript runs your own check when none of these fits.
6. Decide what a finding does
Section titled “6. Decide what a finding does”Each check ends as a match, a discrepancy, unable (a value was missing, so nothing was compared) or an error. Anything but a match is a finding. When a check fails sets what happens next:
- Reject immediately (the default): the block leaves on Rejected. Wire that exit to whatever should happen, such as an Approval.
- Send for correction: the block raises an escalation and the run waits.
Turn on Allow correction on a check to let the reviewer change its values, not only accept them.
Wire all three exits. Approved means there were no findings, Bypassed means a reviewer accepted them, and Rejected means a reviewer rejected them or, without a review, that there were findings.
7. What the reviewer does
Section titled “7. What the reviewer does”The escalation opens on the checks that need attention, with each list’s values side by side and the difference between them. Evidence below them shows the run’s files, such as the scanned documents.
- Accept a row to say the difference is fine, with an optional note. Accept all shown does this for every row on the page.
- Change a value, on a check with Allow correction, then click Apply corrections and re-check. The checks run again on the corrected values, up to 10 rounds.
- Approve continues on Bypassed, and Reject continues on Rejected.
Without a decision, the run waits, and an escalation with no assignee sits in the Workspace queue. See Decide who owns the work.
Large lists
Section titled “Large lists”One step reads up to 20,000 rows across its list checks, and each list can hold up to 10 MiB. Past that, the step fails. The Report output previews the first 25 rows with findings for each list comparison. The Results file holds every row.
Try it
Section titled “Try it”A draft run calls the model and compares for real. A review with no earlier decision raises a real escalation, so you can see what your reviewer will see. Once a real review has been decided, draft runs follow the path it took. See Runs in the editor.