Skip to Content
Case study · Invoice automation

From inbox to spreadsheet — invoices processed with zero manual entry.

A Microsoft Copilot Studio build that watches an email folder, reads each invoice attachment with OCR and AI, and writes clean rows into an online Excel table — routing anything incomplete to a review folder, untouched by human hands.

Platform: Microsoft Copilot Studio + Power Automate
The problem

Someone, somewhere, is still retyping invoices.

Most teams receive dozens of invoices by email every week. Each one gets opened, read, and keyed into a spreadsheet by hand — slow, error-prone, and impossible to audit. Mixed formats make it worse: PNGs, JPEGs, single- and multi-page PDFs all land in the same inbox.

What we built

One pipeline, email to Excel.

A Power Automate trigger feeds a Copilot Studio agent that extracts the data and decides where each file belongs. The agent never sees raw email — it works from a structured OCR file, so the prompt stays lean and the logic stays reliable.

email OCR + boxes SharePoint AI agent extract Excel row error folder
How it works

Six steps, fully unattended.

01

Trigger

A dedicated Power Automate flow watches a "To Process" mail folder and fires only when an email carries attachments — so you control exactly what gets automated by moving mail into that folder.

02

OCR

Each attachment is saved to SharePoint and run through AI Builder text recognition, capturing not just the text but the bounding-box coordinates of where each value sits on the page.

03

Lean hand-off

Rather than dumping the full text into the prompt, the flow stores the OCR result as a file and passes the agent only the file path and the original attachment ID — keeping the agent fast and cheap.

04

Extract

The Copilot Studio agent reads the OCR file and pulls the fields that matter — invoice number, vendor, customer, invoice and due dates, amount, currency — plus a single flag for whether every required field was found.

05

Decide & route

A condition on that flag splits the path: complete invoices get a new row in the online Excel table and the file moves to Processed; anything missing a field moves to the Error folder for review.

06

Reset

Variables clear, the source email moves to the Processed folder, and the flow waits for the next one — no residue, no manual cleanup.

Why the detail matters

The agent receives coordinates, not just a wall of text — so it can tell a vendor address from a due date by where it sits on the page. That spatial context is what makes extraction reliable across wildly different invoice layouts.

The stack

Built entirely on the Microsoft platform.

Microsoft Copilot Studio · agent + orchestration Power Automate · trigger & flows AI Builder · OCR SharePoint · file store Office 365 Outlook · mail folders Excel · invoice register
Documented, not a black box

The whole build lives in flospect.

Every action, variable, prompt, and connection is cataloged — and the documentation is AI-generated from the real flow structure, so it never drifts from what's actually running.

  • Focus & scope, foundation summary
  • Canvas screenshots embedded inline
  • Step-by-step process breakdown
  • KPI, monitoring & document-control sections
  • Owner, version, and last-modified tracking
  • Shareable via a tenant-safe link
Open the library entry →

Want this running in your tenant?

This is the kind of build we ship in a 4-week Flow Build Sprint — architected, tested, and handed over fully documented in flospect.

Book a discovery call
4-Week Flow Build Sprint · fixed project price · one production-ready agent