Download CVCV

Copilot Studio agent cannot read images, scanned PDFs, or other unstructured data in SharePoint, and how to extract and convert them into readable text

Copilot StudioSharePointPower AutomateOCRMicrosoft 365Unstructured Data


You point a Copilot Studio agent at a SharePoint library of scanned invoices, photographed receipts and screenshots of a supplier portal. The knowledge source goes green and reports Ready. You ask it something that is plainly on page two of one of those scans.

Nothing. Or worse, a confident answer assembled from a different document.

So you check the obvious things. The user can open the file. The file comes back in SharePoint search by name. The library is set to appear in search results. You request a reindex, wait for the crawl, and ask again. Still nothing.

The agent is not failing to find the document. It found it on the first try. What it found was a filename, a modified date, and pixels with no text on them anywhere a retrieval system can reach. There is nothing to quote, so it quotes nothing.

The .jpg and .png files are worse off still. Microsoft documents that image, video, executable and audio files cannot be used as uploaded knowledge documents at all, and that images are only supported when embedded in PDF files. That last clause is about pictures sitting inside a text PDF. It is not a promise that a page scanned to an image will be read.

That is the problem this solves. Not discovery, which already works. The text.

The workaround, in one paragraph

The agent’s limitation is not negotiable, so the fix is to stop handing it files it cannot read. That takes two steps, and it matters that they are two.

Convert. There is no text to go and fetch. A scan is pixels, and the readable text has to be produced. SharePoint autofill columns do that: they run a prompt over an uploaded file and save the answer to a library column, and they accept .jpeg, .jpg, .png, .heic, .heif, .tif, .tiff and .pdf. That is the OCR, and it is already in the platform.

Relocate. Converting is not enough on its own, because Copilot Studio grounds on file content and not on list columns, so text sitting in a column is still invisible to the agent. Power Automate assembles the filled columns into a small Markdown file and writes it back beside the original document, where it inherits the same permissions. The agent reads that file.

A staging library sits in front of both steps, because autofill only fires on newly created files and copying into staging is what makes an existing archive look new. Everything below is the detail that makes this hold up in production, including the reconciliation pass that stops the converted text going stale.

If you want the shape before the reasoning, skip to what changes where.

What this corrects

Seven claims that circulate in the forum threads on this, and what is actually true.

The common claim What is actually true
PDF is a supported format, so scanned PDFs work PDF is supported as a container. A scanned PDF is page images with no text layer, so extraction returns nothing. The file indexes on filename and metadata and grounds on zero content
Images work, they are just another file type Image, video, executable and audio files cannot be used as uploaded knowledge documents at all. A .jpg of a signed form is invisible to the agent no matter how it is stored
Images are supported if embedded in a PDF, so wrap them That clause covers pictures sitting inside a text PDF. Wrapping a page scan in a PDF container adds no text layer and changes nothing
The agent cannot find the file It usually finds it immediately. Discovery and grounding are separate failures with the same silent symptom
Reindex the library and it will pick the text up Reindexing an image-only file re-indexes the same zero characters. Reindexing is the fix for a visibility failure, not an absent text layer
Turn OCR on in SharePoint and the agent inherits it SharePoint autofill writes OCR output to list columns. Copilot Studio grounds on file content. See the reading below on why that gap matters
Just use AI Builder It works and it is the answer on every thread, but it needs a premium licence and nobody publishes the end-to-end path. This post stays inside SharePoint and Power Automate

The scope here is anything without a machine-readable text layer, which is most of what people mean by unstructured data in a document library. Scans and photographs are the common case, but the same failure covers screenshots, faxed forms, exported diagrams, and photographed whiteboards.

The reading this rests on

One claim here is inference, not documentation, and it is the claim the whole design turns on.

Copilot Studio grounds on file content. SharePoint autofill saves its output to a library column. Microsoft’s own page on autofill says the saved metadata “can be indexed, used to trigger workflow, or even define criteria for setting an information protection label”, and a Power Platform forum thread opened by a Microsoft employee asks for exactly this gap to be closed, requesting that Copilot Studio index OCR text held in SharePoint metadata columns. The only reply points at Azure AI Search and the Ideas portal.

So: an open request to make columns ground an agent implies columns do not currently ground an agent. That is a reasonable reading and it matches every reported symptom. Microsoft does not document the combination either way, and I have not seen it stated as a limitation in any official page. Treat it as a reading, and confirm it in your own tenant with one file before you build anything on it. The test costs ten minutes: run autofill on a scan, confirm the column is populated, then ask the agent something answerable only from that column.

If your tenant proves the reading wrong, stop here. You do not need this pipeline.

What changes where

Where What
A staging library, ideally on its own site Holds a working copy of each source file long enough for autofill to run. Excluded from search
Autofill columns on staging The OCR itself. One prompt per column, each extracting an organised field
Power Automate, flow A Copies a source file into staging, which is what makes autofill fire
Power Automate, flow B Reads the populated columns, assembles one extract file, writes it beside the source document
The real library Receives <name>.extracted.md next to each source file, inheriting its permissions
Power Automate, flow C Scheduled reconciliation. Handles changed sources and orphaned extracts

In SharePoint

1. Create the staging library

Put it on a separate site if you can. A separate site is outside the scope of any agent pointed at your content sites, which is a stronger guarantee than a library setting.

Staging holds copies drawn from many source libraries under one ACL, together with their fully extracted text in queryable columns. That is a pre-trimming pile of everything, and by default it is indexed and searchable. If a Copilot agent or plain Microsoft Search reaches it, every permission boundary you were careful about downstream is bypassed at the source.

1.1 Library Settings, Advanced settings, set Allow items from this document library to appear in search results to No.

That is the same setting that causes the outage everybody blames Copilot Studio for, used deliberately in the other direction. If your tenant runs Restricted SharePoint Search, keep the staging site off the allowed list.

1.2 Delete staged copies once their extract has been written. Staging is a conveyor, not an archive.

2. Create the autofill columns

Autofill accepts .jpeg, .jpg, .png, .heic, .heif, .tif, .tiff and .pdf, among others, which is what makes it usable as an OCR front end. It writes to Text, Multiple lines of text, Number, Yes/No, Date and time, Choice, Hyperlink, Currency and Managed metadata. It cannot write to Person or Group, Location, Image, or Lookup.

2.1 For every column that will hold extracted prose, open the column settings, choose More options, and set Allow unlimited length to Yes.

Single and multi-line text columns default to a 255 character cap. Miss this and your extraction silently truncates mid-sentence at roughly two lines. With it, the ceiling is 64K characters per column.

2.2 Budget the columns. Microsoft recommends no more than ten per library and files no larger than 65 pages.

This is the real constraint on the whole approach, and it is a design constraint rather than a bug. You do not get one column holding a full-text OCR dump of a long document. You get up to ten columns of 64K, and you get the most out of them by extracting organised fields rather than raw text:

Column: Extract_Header
Prompt: Transcribe all text in the header, footer and any letterhead
        of this document. Return plain text with line breaks preserved.
        If there is none, return NONE.

Column: Extract_Body
Prompt: Transcribe the full body text of this document verbatim.
        Preserve paragraph breaks. Do not summarise, do not add commentary.

Column: Extract_Tables
Prompt: Transcribe every table in this document as pipe-delimited rows,
        one row per line, with a header row first. If there are no
        tables, return NONE.

Column: Extract_Summary
Prompt: In under 100 words, state what this document is and what it is for.

Splitting by structure rather than by page keeps each column’s content coherent, which matters later because the assembled file reads better and the agent cites something meaningful.

Two behaviours worth knowing before you design the prompts. Encrypted files are not analysed at all, so anything carrying an encrypting sensitivity label or a password will come back empty. And subsites are not supported, only sites, including hub sites, sites associated to a hub, and the primary site of a site collection.

In Power Automate

3. Flow A: stage the file

Trigger on file creation in the source library, or run it over a backlog on a schedule.

The only action that matters is Copy file into the staging library. That single step solves the problem the documentation calls out as unsolved: autofill processes files created or uploaded to the library automatically, and Microsoft’s own release notes say bulk processing of existing files is still coming in a future release. A copy is a create. Every legacy scan in a ten year old archive becomes a newly created file the moment it lands in staging, and autofill picks it up without anyone selecting anything in the UI.

That is the whole trick, and it is why staging is worth the extra library rather than running autofill in place.

4. Flow B: assemble and place

Trigger on When an item or a file is modified in staging, not on creation. Creation fires before autofill has finished and you will read empty columns.

4.1 Gate on the columns actually being populated. Autofill uses the same classification status fields as document processing models, so you can condition on that, and you should also check your own columns are non-empty before proceeding:

@and(
  not(empty(triggerOutputs()?['body/Extract_Body'])),
  not(equals(triggerOutputs()?['body/Extract_Body'], 'NONE'))
)

4.2 Compose the extract. Lead with provenance, because this file is a derived copy and in six months nobody will remember where it came from:

Source: {SourceFileUrl}
Source item ID: {SourceItemGuid}
Source modified: {SourceModifiedUtc}
Extracted: {utcNow()}

## Summary
{Extract_Summary}

## Header
{Extract_Header}

## Body
{Extract_Body}

## Tables
{Extract_Tables}

4.3 Write it with Create file, into the same folder as the source document, named <sourcename>.extracted.md.

Same folder is deliberate. The instinct is to mirror the source ACL onto a parallel library, and that is the step where this design quietly breaks. Power Automate cannot faithfully replicate arbitrary item-level unique permissions. If any source document has broken inheritance, your mirrored copy drifts from it and you have created a leak you cannot see. Writing the extract next to its source means permissions are inherited by construction and never copied. Filter the extension out of your user-facing views if the clutter bothers people.

4.4 Delete the staged copy.

4.5 Only generate extracts for files that need them. Copilot Studio uses the top three search results to compose an answer. If you extract text-based PDFs as well as scans, the original and the extract carry identical content and compete for the same three slots, and you have spent one of them on a duplicate. Gate flow A on the source actually being image-only.

5. Flow C: reconcile

An extract is a derived copy with no lifecycle link back to its source. Nothing in the pipeline connects them, so the source can change or vanish and the extract sits there being confidently wrong. Scheduled reconciliation is what turns this from a demo into something you can hand to somebody else.

Key every extract on the source item’s unique ID, not its filename. Filenames change, and matching on them is how you end up with two extracts of the same document.

Source state Action
Modified more recently than the stamped timestamp Re-stage, re-extract, overwrite
Deleted Delete the extract
Moved to another library or site Delete, re-extract at the new location
Now carries unique permissions or an encrypting label Delete the extract, flag for review

The last row is the one that matters most and the one nobody builds first. Autofill will not analyse an encrypted file going forward, which sounds like the compliance story is handled. It is not. The plaintext extract you generated last month, before somebody applied the label, is still sitting in the library inheriting library permissions rather than the document’s new restrictions. Reconciliation is what catches that.

Rerunning autofill, and what not to build on

Reprocessing comes up immediately, because autofill captures document changes only if the file is reprocessed, and the docs say that must be done manually by the user.

Manually, it is supported. Select the files, then More options in the command bar, then Autofill.

From Power Automate, there is no first-party action. Two routes exist and only one of them belongs in a pipeline.

Re-staging is the supported route. Copy the file into staging again, autofill fires on the new copy because it is a new file, and you regenerate the extract. It uses documented behaviour only, and flow C already does it.

The other route is a POST to /_api/machinelearning/workItems through Send an HTTP request to SharePoint. Leon Armston demonstrated it working and states in the same post that the autofill part of the Syntex REST API is not documented and is subject to change. He then reported in his own comments that by February 2025 the backend APIs had changed and some of the scripts no longer ran. Separately, Denis Molodtsov tried nine REST and CSOM strategies against the sibling configuration endpoint, had all nine fail, and fell back to writing field SchemaXml directly.

It is a fine escape hatch to know about. It is a poor foundation for something other people will run in their own tenants.

What this costs

Autofill is billed per page. Microsoft’s pricing page has it at $0.005 per page, reduced from $0.05. There was a promotional allowance of 100 pages a month shared with unstructured document processing, documented as running through June 2026, which has now passed.

Check your own tenant before quoting a number to anybody. Microsoft’s documentation still describes pay-as-you-go, while at least one community report from November 2025 says SharePoint AI moved back to seat-based licensing. Those two accounts disagree and I have not reconciled them.

What is documented, what is observed, what is not known

Documented. Autofill’s supported file types, column types, the 255 character default and the 64K ceiling, the ten column and 65 page guidance, no analysis of encrypted files, no subsite support, no bulk processing of existing files, and manual reprocessing through the Autofill command. On the other side, Copilot Studio’s top-three result limit, the absence of native OCR, and the exclusion of image files as uploaded knowledge documents.

Observable in your tenant, in about half an hour. Whether a Power Automate Copy file into staging reliably triggers autofill at volume. Whether the assembled extract actually grounds an answer and gets cited. Whether the agent prefers the extract over the empty original when both sit in the same folder.

Not known. Whether Copilot Studio will ever index list columns directly, which would make this whole pipeline unnecessary. The forum request is open with no commitment attached. Also unknown is whether the OCR work Microsoft has been shipping into Copilot Chat’s retrieval will reach the Copilot Studio grounding path, and when. Test a raw scan and a raw .jpg as knowledge sources before you build any of this. If they answer, none of the above is needed.

Placeholder checklist

Placeholder What to swap it for
{StagingSiteUrl} The site holding the staging library, ideally not a content site
{StagingLibrary} The staging document library name
{SourceLibrary} The library holding the scans, photographs and screenshots
Extract_Header, Extract_Body, Extract_Tables, Extract_Summary Your own column names, matched in the compose step
{SourceItemGuid} The source item unique ID, stamped into the extract and used as the reconciliation key
<sourcename>.extracted.md Your naming convention, kept consistent so views can filter it

Troubleshooting

Ordered by how much time each one costs before you work it out.

Symptom Cause Fix
Extract file exists, agent still answers nothing The agent has no Copilot licence in tenant and the file exceeds 7 MB, or the knowledge source scope does not include the folder Confirm the file size limit that applies to you. It is 7 MB without a Microsoft 365 Copilot licence in the same tenant, 200 MB with one
Columns populate, extract file is empty Flow B triggered on create rather than modify, and read the columns before autofill finished Trigger on modify, gate on the columns being non-empty
Extraction stops mid-sentence around two lines in The column is still on the 255 character default Column settings, More options, Allow unlimited length, Yes
Autofill never runs on the backlog Autofill does not process files that existed before the column was created Copy them into staging so they register as new files
Some files always come back empty Encrypted, password-protected, or carrying an encrypting sensitivity label Autofill does not analyse these at all. Exclude them and flag them
Agent cites the extract but misses the newest content The source changed and autofill does not reprocess on edit Flow C, keyed on modified timestamp
Answers quote a document that was deleted weeks ago Orphaned extract Flow C, keyed on source item unique ID
Agent gets worse after the pipeline runs Extracts of text PDFs are duplicating originals and consuming the three retrieval slots Only extract image-only sources
Staged content turns up in an unrelated agent Staging library is indexed and in scope Set the library to not appear in search results, or move staging to its own site

References