AI Data Validation
The AI Data Validation action checks a Record against validation rules you write in plain English — "line item amounts must add up to the invoice total", "the vendor must exist in the Vendors list and its payment terms must match", "the due date cannot be before the invoice date" — and records a pass or fail verdict on the Record with a finding for every rule. You do not describe the data the rules need. The action works out for itself which other Records or Server Data values a rule refers to, pulls them, and compares.
Use it wherever a person would otherwise read a Record and its reference data side by side before approving it: invoices against a vendor master, expense claims against policy limits, applications against eligibility rules, orders against a price list.
AZURE ONLY: This is an AI action and runs only on Azure-hosted / AI-licensed sites.
Setting it up
- Create a workflow step for the validation and add AI Data Validation as its incoming action.
- On the Rules tab, type the rules, one per line.
- On the Data Plan tab, choose the Record Type and click Preview Data Plan to confirm the lookups the rules will use.
- Assign the step to docMgt_Agent. The action shows a warning with an Assign to docMgt_Agent button while the step is unassigned.
- Give the step a default Complete button for Records that pass and a default Reject button for Records that fail, and put the follow-up actions for each outcome on those buttons.
A typical set of rules for an invoice looks like this:
- Line item amounts must add up to the Invoice Total.
- The Vendor ID must not be blank.
- The vendor must exist in the Vendors list and its Terms must match the Terms on this invoice.
- The Due Date must not be before the Invoice Date.
- The PO Number should be filled in.
The first four are requirements and fail the Record when broken. The last is worded as a preference, so a missing PO Number is reported as a warning and the Record can still pass.
How a Record is validated
The first time a set of rules runs against a Record Type, the AI reads the rules together with the Record Type's fields and a catalog of the other Record Types and Server Data on your system, and builds a data plan: the short list of lookups the rules need, such as "the Vendors record whose Vendor ID matches this Record's Vendor ID" or "the Approved Terms server value". The plan is kept and reused for every Record that follows, so it is built once, not once per Record. Editing the rules builds a new plan automatically.
For each Record the action then runs the plan's lookups, gathers the Record's own fields and line items together with the totals, counts, smallest and largest values of each numeric line column, and asks the AI to judge every rule against that data. Each rule gets one of four outcomes:
- Pass — the rule holds.
- Fail — the rule is broken. Rules worded as requirements ("must", "make sure", "verify") fail when broken.
- Warn — a softer rule is not met. Rules worded as preferences ("should", "flag", "ideally") warn instead of failing, and warnings do not fail the Record.
- Skipped — the rule could not be checked because something it needs was missing: an empty field, or a lookup that found nothing. A skipped rule counts as a failure, and its finding says exactly what was missing, so a Record can never pass simply because the data to check it was not there.
The Record passes only when every rule passed or warned.
What the action writes
The verdict is written to the Record as a set of values whose names begin with AIValidate_, replacing any values left by an earlier run:
- AIValidate_Passed — True or False.
- AIValidate_Summary — a short plain-English summary of the outcome.
- AIValidate_Errors, AIValidate_Warnings, AIValidate_Skipped — the findings for the failed, warned and skipped rules, with the actual values that were compared.
- AIValidate_FailCount, AIValidate_WarnCount, AIValidate_SkippedCount, AIValidate_CheckCount — the counts behind the verdict.
- AIValidate_JSON — every finding in full, for reports, e-forms or a JSON Loop.
You can also have the verdict written into fields of your own choosing, and added to the Record as a note, using the Results options below.
How the action runs in a workflow
Judging a Record with AI takes a few seconds, and a busy workflow can have hundreds of Records arriving at once, so the judging is done by an AI job that runs in the background, the same way AI/OCR/Barcode Processing works. Place the action as a step's incoming action and assign that step to a user — preferably docMgt_Agent. The workflow item then waits at the step while the job runs. When the job finishes it writes the AIValidate_ values and acts on the waiting item: a Record that passed is completed with the step's default Complete button, and a Record that failed is rejected with the step's default Reject button. If the step has no default Complete button or no default Reject button, the item still moves on from the step when the job finishes, as if the step were simply done; in that case use the AIValidate_Passed value in the rules of the step that follows to send passed and failed Records different ways.
The step must be assigned for the workflow to wait. If it is not assigned to anyone, the workflow moves on as soon as the job is queued, the verdict is not available to the steps that follow, and the job finds no workflow item to complete or reject. The action shows a warning when its step is unassigned, with a button that assigns it to docMgt_Agent for you.
Put any follow-up work — an email about the failures, a note, a status field — on the step's Complete and Reject buttons rather than after the action in the same action list; actions listed after it run right away, before the verdict exists. If someone completes or rejects the item by hand before the AI finishes, the job simply records its verdict and leaves the item alone.
While a job is waiting or running, anyone who opens one of the Record's documents sees a status badge beside the document name showing AI Data Validation and its current status, the same way a document that is being read by OCR shows its OCR status. The badge disappears when the job finishes.
Each job is listed on the AI Workflow Processing report from the moment it is queued, with its status, and with its tokens and timing once it has run. A job that could not run — because the AI service was unavailable, for example — is shown there with the reason. Nothing is emailed.
Running the action from an Add-In button validates the Record in the same way; the values arrive on the Record shortly afterward, and there is no workflow item to complete.
Options
Rules
Validation Rules — The rules, one per line, in plain English. Write each one as a complete statement about the Record ("Every line item must have a quantity greater than zero"). Name fields the way they are named on the Record Type, and name other Record Types and Server Data values the way they are named on your system, so the plan can find them. A rule that bundles several conditions is judged as several findings, one per condition.
Extra Instructions — Optional. Anything the AI should know while planning and judging that is not itself a rule: what "the vendor list" means on your system, that Net30 and Net 30 are the same, which fields hold dates in a particular format.
Data Plan
Preview For — The Record Type the rules will run against. Choose it before previewing; pick No Record Type when the Records the step handles have none.
Preview Data Plan — Builds the plan for the rules above against the Record Type chosen in Preview For, and shows the lookups the rules will trigger. When the rules need nothing beyond the Record itself, the preview says so and no lookups run. Use it to confirm the rules are understood before the action runs on live Records; if a lookup is missing or aimed at the wrong list, reword the rule and preview again. The plan you preview is the one the action uses, so previewing also saves the first Record a planning step.
Fields to Include — Optional. One field name per line. When set, only these fields and line item columns are sent for judging; leave it empty to send every field the Record Type defines. Use it on Record Types with many fields the rules never mention.
Reference Data — Optional. Extra data to judge against that is not held in a Record or a Server Data value: a short list of approved values, a rate table, a policy excerpt. Accepts plain text, CSV or JSON, and you can use [DOCUMENTEXT(ID)] to load it from a document or [SERVERDATA(name)] from a Server Data value.
Results
Result Field — Optional. A field on the Record to receive Passed or Failed, for searching, reporting and workflow filters.
Message Field — Optional. A field on the Record to receive the summary.
Add Record Note — When on, the verdict and its findings are added to the Record as a note, where reviewers see them alongside the Record's other notes.
AI Level
Quality — Balanced suits most rules. Maximum costs more and is worth it when rules involve subtle comparisons or messy data; Economy is the cheapest and is fine for simple presence and range checks on small Records.
TIPS
Write rules the way you would explain them to a new reviewer. "The PO number must match an open purchase order for the same vendor" gives the AI both the lookup and the comparison; "check PO" gives it neither.
Keep the rules text free of variables such as [FieldName]. The rules are meant to describe every Record of the type, and the AI already sees the Record's values when it judges; a variable would make the plan rebuild for every Record.
Start with the AI Workflow Processing report open. The first few runs show you which rules are being skipped, and a skipped rule nearly always means a name in the rule does not match a field, Record Type or Server Data name on your system.
A failed rule is a normal outcome, not an error. Build the Reject side of the step to do something useful with it — route to a reviewer, send the findings with [AIValidate_Errors] in an email, set a status — rather than expecting the workflow to stop.
Negative amounts are judged as they are. A credit memo whose line items are negative will fail a rule that compares their total to a positive header amount; word the rule for the documents the step actually receives, or mention credits in Extra Instructions.
Previewing the plan and building it for the first Record both use Workflow AI tokens, once per set of rules. After that each Record uses tokens for a single judging call.
NOTE ON (AI): Validating Records with AI consumes tokens and may incur extra fees. Workflow tokens are billed separately from End-User or Admin tokens — check with your sales rep for more information. Please verify all results, as AI can make mistakes.