Caution
Disclaimer
This accelerator is provided "as is", without warranty of any kind. It is a personal sample, not an official Microsoft product, and is not supported by Microsoft Support.
Neither Microsoft nor the author is responsible for how this tool is used or for any impact it has on your environment, including but not limited to:
- Data — records created, modified or overwritten by the solution and its flows
- AI credit consumption — every extraction run consumes AI Builder / Copilot credits
- Database capacity — Dataverse storage used by records, attached files and run history
Review and test it in a non-production environment before any wider use. There is no guarantee of updates, bug fixes or ongoing maintenance.
A reusable document-processing accelerator for Microsoft Power Platform. Upload an invoice or a receipt, and AI Builder extracts its contents into Microsoft Dataverse through a status-driven processing pipeline.
Built as a demonstration accelerator: the architecture is deliberately small, portable and easy to read rather than a production accounting system.
- Capture — create an Invoice or Receipt record and attach a PDF or image.
- Submit — move the record to Ready to Process.
- Extract — a cloud flow picks it up and runs one of two AI Builder paths, chosen per record:
- a prebuilt model (Invoice Processing / Receipt Scanning), or
- a custom prompt returning strict structured JSON.
- Write back — extracted values, processing metadata and any error land on the originating
record, which is renamed from what was extracted, e.g.
Contoso Supplies Ltd · 2026-03-11 · 1073.50 CAD.
Every document moves through one shared lifecycle:
Draft → Ready to Process → Processing → Completed
↘ Failed → (retry) → Ready to Process
Users own Draft and Ready to Process. The automation owns everything after that, and a record is never left stranded in Processing — every branch, including failures, writes a terminal state with a readable error.
| Piece | Description |
|---|---|
| Dataverse | Invoice and Receipt tables with a file column, shared lifecycle choices, and full processing diagnostics |
| Model-driven app | Document Processing Hub — administration and testing: forms, status views, security roles |
| Cloud flows | Process Invoice Document and Process Receipt Document — trigger filtering, idempotency guard, try/catch scopes, and a switch across the two extraction methods |
| Code app | Document Processing Experience — a tailored React + TypeScript UI over the same tables |
Each flow claims the record, reads the document, then branches on the record's Extraction Method — never on the file type. Both branches converge on one completion path, so the field mapping is written once.
Document Processing Hub is the administration and testing surface: capture a record, attach a document, pick the extraction method, and inspect everything the flow wrote back.
A full-height app shell rather than a long scrolling page: a left panel for navigation and filters, and a master–detail documents view.
- Drag and drop a file anywhere to create a document, or onto a record to attach or replace one
- Names default from the file name, then get rewritten from the extracted values
- In-app preview of the stored PDF or image
- Search, status and method filters, and sorting
- Light and dark themes, in the Microsoft brand palette
code-app/ React + TypeScript + Vite source for the code app
solution/ Unpacked Dataverse solution source
packages/ Managed and unmanaged solution zips
flows/ The two cloud flow definitions
docs/ App spec, custom prompt text and screenshots
sample-documents/ Synthetic invoice and receipt for testing
- A Power Platform environment with Dataverse
- AI Builder licence and capacity — the extraction step needs it
- Power Apps Code Apps enabled in the environment
- Power Platform CLI, Node.js 22+
Grab the zips from the latest release or packages/:
pac auth create --name target
pac env select --environment https://<your-env>.crm.dynamics.com/
pac solution import --path DocumentProcessingAccelerator_managed.zip --activate-plugins
pac solution publishUse the unmanaged package for a development environment.
cd code-app
npm install
cp power.config.example.json power.config.json # then set your environment id
pac code init -n "Document Processing Experience" -env https://<your-env>.crm.dynamics.com/ -b dist
pac code add-data-source -a dataverse -t dpa_invoice
pac code add-data-source -a dataverse -t dpa_receipt
npm run build
pac code pushA few identifiers are environment-specific and need re-pointing:
- Create the two AI Builder custom prompts using the text in
docs/custom-prompts.md, then set therecordIdofRun_a_promptin each flow. - Re-resolve the prebuilt AI model ids and update the
recordIdof the Process invoices / Process receipts actions. - Assign the security roles — Document Processing User and Document Processing Administrator.
- Turn both flows on if they import stopped.
- AI Builder is required. Without licence and capacity the flows run their full lifecycle but end in Failed with an actionable error, by design — nothing is fabricated.
- Custom prompts are created in the maker UI. They can't be created end to end through the API; the prompt text and wiring are documented so it's a copy-and-publish step.
- Business rules are skipped where the environment doesn't support authoring them through the API; the equivalent validation runs as a form script instead.
- Line items are stored as JSON rather than in a normalized child table, deliberately, for the first version.
- The sample documents are synthetic — generated for testing, containing no real data. Where a screenshot showed values extracted from real documents, those rows are redacted.
Out of scope by design: approvals, ERP integration, vendor matching, duplicate detection, purchase-order matching, payments, and email ingestion. The data model leaves room for them later.
MIT. Provided as is — see the disclaimer at the top of this page.


