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 |
| AI Builder prompts | Extract Invoice Fields (DPA) and Extract Receipt Fields (DPA) — structured-JSON custom prompts for the prompt branch (details) |
| Code app | Document Processing Experience — a tailored React + TypeScript UI over the same tables |
Everything above ships in one solution. Import it and every component is in place — tables, apps, flows and prompts — with nothing to create by hand.
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 reference 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
Download a zip from the latest release (or packages/) and import it through
make.powerapps.com → Solutions → Import solution, or with the
Power Platform CLI:
pac auth create --environment https://<your-env>.crm.dynamics.com/
pac solution import --path DocumentProcessingAccelerator_managed.zip
pac solution publishUse the managed package to run the accelerator, and the unmanaged package if you want to customize it.
- Turn on both flows. Open Process Invoice Document and Process Receipt Document, confirm the Microsoft Dataverse connection, and turn each flow on.
- Assign the security roles — Document Processing User and Document Processing Administrator.
- Share the apps — Document Processing Hub and Document Processing Experience — with your users.
The AI Builder prompts and prebuilt models need no re-pointing: prompt ids are preserved on import, and the prebuilt model ids are the same in every environment.
The code app ships built inside the solution. To change it, edit the source in code-app/ and push
it back with Power Platform CLI and Node.js 22+:
cd code-app
npm install
cp power.config.example.json power.config.json
# set environmentId, and appId to the imported app's id (make.powerapps.com → Apps → Details)
# so the push updates that app instead of creating a second copy
npm run build
pac code push- 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.
- The prompts default to CAD when a document doesn't state its currency. Adjust the rule in each prompt if your documents are mostly in another currency — see custom prompts.
- 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.


