Document quality control · Free validation lab

Document Data Validation: Guide & Interactive Validation Lab

Document data validation checks extracted values against required fields, formats, arithmetic and trusted records before they can move forward. Try the free lab to see which rules catch a problem and when a person must decide.

By Terry WilliamsPublished September 11, 2026Updated November 2, 2026OpSmith field guide
Free interactive lab · Worked examples

Document Validation Lab

Try a flawed invoice, change the rules and see what reaches the next approval gate. No uploads, AI calls or account required. Entries stay in this page’s memory; export before leaving.

The stated total exceeds subtotal plus tax by CAD 50, despite 99% extraction confidence.

Example invoice · proposed extracted values

Inspect the evidence

These editable values represent extracted fields—not an OCR upload. For this simplified CAD example, subtotal is the supplied line-item sum; tax is an input, not tax advice.

Reference evidence

Approved PO: PO-1042
Supplier: SUP-014
Example Industrial Supply (worked example)

Existing ledger entry: INV-2038 / SUP-014

2. Configure six checks

Disable a check to explore the consequences. This does not make it safe to remove that control in production.

Require invoice number and supplier; optionally require a purchase order.

Invoice: INV- plus four digits. PO: PO- plus four digits when present. Non-negative CAD amounts with at most two decimals.

Compare subtotal plus tax with the total using the chosen tolerance.

Check the supplier and invoice-number pair against the sample ledger.

Compare the supplier to the approved supplier for this purchase order.

Route results below your threshold for review. Confidence does not override another failed rule.

3. Follow the decision

Review

Send the failed rules, source values and reference evidence to an authorized reviewer. Do not post automatically.

  1. Extracted proposal
  2. Enabled rules + available evidence
  3. Authorized review

Required fields

Passed

Required identifiers are present.

Field formats

Passed

IDs and CAD amounts match this example’s format contract.

Total reconciliation

Failed

Subtotal + tax differs from total by CAD 50.00; your tolerance is CAD 0.02.

Next: Ask the invoice owner to reconcile the amounts with the source. Tax-rate correctness is outside this demo.

Duplicate invoice

Passed

No matching supplier/invoice pair in the sample ledger.

Supplier / PO match

Passed

PO PO-1042 expects SUP-014; the document proposes SUP-014.

Extraction confidence

Passed

Supplied confidence 99% versus threshold 90%. This is an example input, not a model run.

When work must stop, use the exception recovery runbook builder to define the owner, holding state and safe resume point.

Test your rules

What would this policy let through?

The fixed set contains 3 valid, 6 invalid and 1 unverifiable case. Labels use the example’s original contract, including a CAD 0.02 rounding limit; changing your tolerance does not relabel the evidence. Your edits above do not change this fixed test set.

Run the labelled cases to see missed problems and review workload under your policy.

Keep the rules and test evidence

Exports use the current policy. The matrix lists enabled checks and failure handling; the test CSV evaluates all ten fixed cases. The full JSON includes your edited sample, policy and results.

Planning example only. Adapt the rules, reference systems, field-level confidence and approval authority to your real workflow. No payment, posting or source-system update is performed.

In short
  • Validate the fields that determine the business outcome, not every extracted value with the same level of control.
  • Combine model confidence with deterministic rules, cross-field checks and approved source records; none of these is sufficient by itself.
  • Failed validation should produce a contained, explainable review task—not a guessed value or a generic error message.
Document data validation workflow checking required fields, formats, calculations, duplicates and source records before human review or system update.
Validation combines deterministic business rules, source comparison and proportionate human review before extracted data changes a business system.

Extend the validation lab into an independent field-level test contract

The existing lab demonstrates why 99% extraction confidence cannot cancel a failed arithmetic rule. The reference pack adds a portable record of expected outcomes so the explanation can be reviewed outside the interface. INV-101 states 1000 plus 50 but prints 1100; the arithmetic difference is 50 against an example tolerance of 0.02.

Independently label each case before configuring rules. A valid case is eligible for its next approval gate, not automatically posted or paid. An unavailable supplier lookup remains unverifiable even if every printed field is clear. A duplicate candidate requires identity review because repeated receipt and a legitimate second invoice can resemble each other.

Treat a disabled check as a change to the decision policy. If arithmetic validation is switched off and the inconsistent invoice progresses, that is a missed error in the teaching experiment, not proof the invoice became valid. Expected labels must remain fixed when testing a policy so you can see what the policy fails to catch.

Worked example. The supplied records and decisions are inspectable reference material, with no claimed customer results or measured model performance.

A useful validation matrix separates evidence and consequence
CheckExpected evidenceFailure versus unavailable
Required fieldsOriginal and proposed schemaMissing field blocks required use
ArithmeticIndependent calculationKnown discrepancy routes to review
Supplier/POAuthoritative source recordUnavailable evidence holds; not a pass
DuplicateIdentity and destination comparisonPossible match needs review
ApprovalAuthorized decision on versionRequired authority remains separate

Download the working files

Use the completed example and templates alongside this guide. Files open directly with no signup.

Worked example: a confident extraction with a wrong total

The lab starts with an example invoice showing a CAD 1,000.00 subtotal, CAD 50.00 tax amount and CAD 1,100.00 total. The supplied extraction confidence is 99%, but the arithmetic differs by CAD 50.00. With the example CAD 0.02 tolerance, the arithmetic rule fails and the proposed record goes to review. The confidence check cannot cancel that failure.

Switch off total reconciliation and the same invoice can reach the next approval gate under the remaining rules. Run the fixed sample set to see the missed error. This is a deliberate teaching exercise, not a recommendation to disable a control. The CAD amounts, identifiers, confidence values and rounding contract are part of the worked example; tax-rate validation, payment authority and real supplier verification are outside the lab.

Proceed

Enabled checks found no blocker. The record still needs any required business approval before posting or payment.

Review

A rule found conflicting values or low confidence. An authorized person needs the source and the exact failed check.

Hold

A blocking failure or unavailable evidence prevents a decision. Preserve the item and obtain the missing information first.

A correctly extracted value is not automatically valid

Extraction asks whether the system captured what appears on the document. Validation asks whether that captured value is complete, plausible, consistent and appropriate for the intended action. Those are different questions. An invoice can clearly show an incorrect purchase-order number; perfect extraction would faithfully reproduce the wrong value.

Place validation between extraction and the acceptance gate in the wider document processing workflow. Keep proposed values in a staging state until the critical rules and required approvals have completed.

Extracted

The value and its source location were captured from the document.

Normalized

The raw value was converted into the required date, amount, identifier or address format.

Validated

The proposal passed the applicable rules and source comparisons.

Accepted

The workflow or authorized reviewer approved the value for the defined downstream use.

Classify fields according to business consequence

Not every value deserves the same validation effort. Identify the fields that determine identity, amount, terms, routing or authority. A mistaken customer identifier or payment total can affect a material action; an optional note may be safe to leave blank or present only for reference.

For each field, document whether it is required, the permitted format and range, which source is authoritative, how uncertainty is detected and what happens when the rule cannot run. This becomes the validation contract for implementation and testing.

Critical

A wrong value can create a material customer, financial, contractual or access consequence.

Operational

The value controls routing, ownership, timing or the next processing step.

Supporting

The value helps a reviewer understand the item but does not determine the action.

Unneeded

The workflow has no approved purpose for collecting or storing the field.

Layer simple rules before complex judgment

Run inexpensive deterministic checks before asking a model or person to interpret an ambiguous case. A missing required field, invalid date, impossible total or known duplicate can be identified without a subjective decision. Early checks also prevent weak inputs from contaminating later steps.

Treat unavailable evidence differently from a failed rule. If the customer database is offline, the workflow does not know that the proposed customer is invalid; it knows the comparison could not be completed. That distinction determines whether to retry, review or reject.

Presence

Confirm required fields and required source pages exist.

Type and format

Test dates, identifiers, allowed values, lengths and numeric boundaries.

Cross-field

Recalculate totals and compare related dates, names, quantities or addresses.

Source-system

Match against an approved customer, vendor, order, contract or case record.

Use confidence as a routing signal, not a correctness certificate

Field confidence can help identify low-quality scans and uncertain extraction, but the same threshold should not be applied blindly to every field or document type. A high-confidence total still needs arithmetic validation; a moderately confident note may be acceptable when it cannot trigger an action.

Choose thresholds using representative documents and the consequence of error. When evidence remains uncertain or only a person may accept the action, use a purposeful human-in-the-loop automation decision.

Auto-accept

Only when required rules pass and the consequence supports automatic completion.

Review

Route an uncertain or consequential value with its source and failed checks.

Reject

Stop inputs that are unreadable, prohibited or outside the approved workflow boundary.

Sample

Review a controlled subset of lower-risk accepted items to monitor quality over time.

Turn each failed rule into an efficient review task

A reviewer should not have to rediscover why an item stopped. Display the original document region, proposed normalized value, failed rule, relevant source-system value and permitted actions together. Preserve the proposal and final correction so the outcome can be explained and recurring patterns can be measured.

Avoid silently overwriting extracted data. An approved deterministic normalization can create a separate normalized value; a material correction should retain who or what made the change, the reason and the source that supports it.

Specific reason

Name the missing field, mismatch, threshold or unavailable dependency.

Complete evidence

Show the page region and relevant business record beside the proposal.

Approved actions

Offer correct, accept, reject, request information or escalate as appropriate.

Decision trace

Record the reviewer, time, original proposal, final value and disposition.

Test validation with normal, boundary and exceptional documents

A useful test set includes ordinary documents, known bad inputs and values near every material boundary. Test missing fields, conflicting totals, unknown entities, duplicates, damaged scans and temporarily unavailable source systems. Record the expected rule outcome before running the test.

After launch, monitor critical-field correction rate, failed-rule frequency, reviewer disagreement, auto-accept rate and errors discovered downstream. Review thresholds when document layouts, suppliers, policies, integrations or consequences change—not simply because the model reports a different confidence distribution.

Rule coverage

Connect every critical field and consequential action to an explicit acceptance rule.

Boundary cases

Test values just inside and outside tolerances, limits and date ranges.

Downstream check

Verify that accepted data created the correct record and status in the destination.

Change control

Retest representative evidence and preserve a rollback path before production changes.

Build validation around the decision the document supports

Start with one document type and write the field-level acceptance matrix before tuning extraction. The matrix makes implementation testable and prevents a visually impressive extraction demo from becoming an unreliable operating process.

Use the lab’s exports as a starting structure, not production configuration. Replace worked examples with permissioned, representative examples labelled by your team; add field-level rules, known supplier variations, real duplicate keys, approval ownership and unavailable-system tests. Keep the evidence labels independent of the rule settings so a looser policy cannot make its own mistakes disappear.

OpSmith’s document processing automation work connects extraction to business rules, source evidence, review and the verified destination update.

Evaluate errors by their operating consequence

Report false progression and unnecessary review separately. A false progression is a case that should have been held or reviewed but advances. Unnecessary review consumes time on cases that the approved policy could safely handle. Neither can be understood from a single overall accuracy percentage, especially with a small set of worked examples.

Score critical fields and dispositions independently. The correct route with the wrong supplier ID is not a reliable final record. Keep rule outcomes, source availability, confidence and human corrections visible. Test tolerance boundaries with integer cents where appropriate rather than relying on display-rounded values.

Move from fixtures to actual permitted documents before making production claims. Add layout variation, missing pages, unusual suppliers and inconsistent authoritative records. Preserve source locations and a review explanation. Use the fixture results to validate the rule implementation, and a separate extraction evaluation to validate how values are obtained.

Try it with your own process

Run the lab with the arithmetic rule on, then off, while keeping the same labelled cases. Record the disposition differences and explain each missed error. Download the matrix and add one real business requirement with its evidence source, failure result, unavailable result and owner. Test all four conditions before adding a confidence threshold.

Acceptance checks for this example

  • Expected labels do not change when a check is disabled.
  • Known mismatch and unavailable evidence remain distinct.
  • No success rate from the worked examples is represented as production model accuracy.

Technology choices and what to test

Structured outputs from current models can stabilize field formats, but schema adherence is not business correctness. Keep the model/API version, prompt, schema and validation rules in separate fields so a changed result can be traced to the component that changed.

Compare specialized document extraction and current general models using the same expected critical fields. The lab itself makes no AI calls and does not inspect uploads. Its teaching value is in visible rules and fixed labels, not a hidden model accuracy claim.

Technology references checked October 28, 2026. Model availability and platform behavior can change; confirm the current documentation before implementation.

Compare candidates on a labelled sample from the intended workflow: correctness, preserved unknowns, unsafe proposed actions, reviewer effort, latency and cost. Keep expected outcomes separate from generated answers. Record model identifier, settings, prompt, rules and connector version so a change can be tested against the same cases.

Compare possible duplicates beyond one exact identifier

The validation lab tests a bounded duplicate rule. For the separate question of differently formatted numbers, recurring periods, credits and revisions, use the duplicate invoice detection tool. It explains why a pair needs review without treating every equal amount as the same payable.

The bill of lading data extraction example tests another failure mode: a plausible field with the wrong unit, magnitude or packaging level. Source meaning must survive normalization before a value changes a transport record.

Retest rules and model changes against fixed expected outcomes

The automation regression testing checklist tests stale versions, missing evidence and uncertain side effects as well as valid output. It shows why a high aggregate pass rate cannot overrule an unresolved critical release gate.

Frequently asked questions

What is document data validation?

Document data validation checks whether extracted information is complete, correctly formatted, internally consistent, supported by approved source records and safe to use for the intended business action.

What is the difference between extraction confidence and validation?

Extraction confidence estimates how certain a model is about its output. Validation tests that output against explicit requirements and evidence. A confident value can still violate a business rule or refer to the wrong record.

Which extracted fields need the strongest validation?

Prioritize fields that determine identity, money, contractual terms, access, customer communication or irreversible system actions. Low-consequence descriptive fields may use lighter controls.

Should validation automatically correct document data?

Only when the correction rule is approved, deterministic and reversible. Ambiguous changes should be proposed with their evidence and routed to an authorized reviewer.

How should failed validation be handled?

Contain the item, preserve the original document and proposed values, identify the failed rule, assign an owner and resume from a safe point after correction or approval.

Does the validation lab process my documents or measure production accuracy?

No. The free lab runs explicit rules against editable example invoice fields and ten labelled worked examples. It makes no AI or source-system calls, uploads nothing and keeps edits only in this page’s memory. Its results explain the example policy; they do not estimate accuracy on your documents or authorize posting or payment.

Sources and further guidance

These official references provide relevant technical, privacy, risk-management or accountability guidance. OpSmith applies the useful principles to the operation of one business workflow.

About the author

Terry Williams

Terry is the founder of OpSmith. He maps operational workflows, designs the human approval and exception paths around them, and builds automation systems for established Canadian businesses.

About Terry Williams and OpSmith
Continue the topic

Related field guides

Use the next guide that matches the decision your team is making now.

Want a second set of eyes on the workflow?

Bring one recurring process to a free 20-minute consultation. OpSmith will help you decide whether it is ready for automation, needs process cleanup first or should remain human.

Discuss the workflow ↗