#PowerPlatformTip 143: Reduce AI Costs with Thumbnail-First Document Processing
TL;DR: SharePoint renders a thumbnail image of page 1 for every PDF. Send that image to your AI model first, check the required fields, and process the full PDF only as a fallback. You pay for one image instead of every page whenever page 1 holds the data.
๐ก Challenge
AI document processing is billed per page or per call. Since 1 November 2025, AI Builder features in Power Apps and Power Automate consume Copilot Credits once AI Builder credits are exhausted, and from 1 November 2026 new premium licenses no longer come with seeded AI Builder credits. Many business documents like invoices run to several pages, but the critical information often sits on the first page only. Processing entire PDFs with Azure AI Document Intelligence, the OpenAI Vision API, or AI Builder spends AI capacity on terms, legal disclaimers, and appendices that hold no extractable business data. Check the current price list of your provider before you calculate savings.
โ Solution
Implement a thumbnail-first strategy in Power Automate. Whether documents arrive via Power Apps upload or email attachment, save them to SharePoint first, use Get File Properties to access the thumbnail, send it to your AI provider for extraction, validate the results, and only process the full document if required fields are missing or confidence is too low. This approach works with any AI service that accepts image input, and the fallback logic makes sure the full document is processed whenever the thumbnail is not enough.
flowchart TD
A["Document saved to SharePoint"] --> B["Get file properties<br/>read thumbnail URL"]
B --> C["Send thumbnail to AI provider"]
C --> D{"Required fields present<br/>and confidence high enough?"}
D -->|Yes| E["Done - full document not processed"]
D -->|No| F["Fallback: process the full PDF<br/>with the same provider"]
F --> G["Use full-document result"]
๐ง How Itโs Done
1. Configure document intake and save to SharePoint
๐ธ Power Apps: user uploads a document โ Create file to save it in a SharePoint library.
๐ธ Email: when a new email arrives (with attachments) โ Apply to each attachment โ Get attachment content โ Create file in SharePoint.
๐ธ Both paths must save the document to SharePoint first, before accessing thumbnails.
2. Get file properties to access thumbnail metadata
๐ธ Add โGet file propertiesโ immediately after file creation.
๐ธ Id is the list item ID from the previous action: outputs('Create_file')?['body/ItemId'].
๐ธ This exposes all file metadata, including thumbnail URLs.
๐ธ The thumbnail is only available after the file is saved to SharePoint, not during upload.
3. Extract the thumbnail URL
๐ธ Use the expression @{outputs('Get_file_properties')?['body/{Thumbnail}/Large']}.
๐ธ Available sizes: Small, Medium, Large (Large gives the best quality for AI).
๐ธ No Parse JSON needed, direct access to the thumbnail URL.
4. Convert the thumbnail and send it to your AI provider
๐ธ Download the thumbnail from the URL, for example with an HTTP action that authenticates against SharePoint (HTTP with Microsoft Entra ID).
๐ธ Note: the HTTP actions require a Power Automate Premium licence. The thumbnail URL is only reachable with authentication.
๐ธ Send the image to the model of your choice: AI Builder Extract information from invoices accepts JPG and PNG as well as PDF, and Azure AI Document Intelligence or a vision-capable model accept images too.
5. Validate completeness and confidence
๐ธ Check that all required fields are populated (invoice number, date, total, vendor).
๐ธ Compare confidence scores against a threshold you define.
๐ธ If validation passes โ stop here and skip the full-document processing.
6. Add a conditional fallback
๐ธ Condition: IF required fields missing OR confidence below your threshold โ process the full PDF with the same provider (Get file content on the original).
๐ธ ELSE proceed with the thumbnail-extracted data.
๐ธ Log the success/fallback ratio for ongoing optimization.
7. Monitor savings and success rates
๐ธ Track the thumbnail-only success rate for your document types.
๐ธ Compare monthly cost: thumbnail-first vs. full processing.
๐ธ Estimate the saving with the current prices of your provider and your own page counts.
๐ Result
Only documents where the thumbnail is not enough are processed in full, so you pay for fewer pages, and the fallback makes sure no document is skipped. The approach is not tied to one AI provider.
๐ Key Advantages
๐ธ Universal intake: works with Power Apps uploads, email attachments, or any source, just save to SharePoint first.
๐ธ Cost optimization: fewer pages are processed, whichever provider you use (Azure AI, OpenAI, Google Document AI, AI Builder).
๐ธ Fallback: full documents are processed only when thumbnail extraction is insufficient.
๐ธ Simple syntax: direct thumbnail access via @{outputs('Get_file_properties')?['body/{Thumbnail}/Large']}, no complex JSON parsing.
๐ธ Platform agnostic: works with any AI service accepting image input, protecting against vendor lock-in.
๐ธ Performance: smaller payloads usually mean shorter processing time.
๐ธ Licensing: the SharePoint actions are standard. The HTTP calls need a Premium licence, as do some AI provider connectors.
โ ๏ธ Good to Know
๐ธ Page 1 only. The SharePoint thumbnail shows the first page of the document, at a reduced resolution. The pattern pays off for documents whose key fields sit on page 1 (invoice number, date, vendor). If the total is on the last page of a multi-page invoice, the validation in step 5 fails and the fallback processes the full PDF.
๐ธ Small fonts. Fine print can be unreadable in the thumbnail. Use Large, and let the confidence check send unclear cases to the fallback.
๐ธ Measure before you promise. How much you save depends on your page counts and the share of documents that pass on the thumbnail. Log both (step 7) and calculate with the current rates of your provider.
๐ ๏ธ FAQ
1. Why must I save to SharePoint first instead of processing uploads directly?
SharePoint generates thumbnails automatically when files are saved to document libraries. The thumbnail isnโt available during upload, only after SharePoint processes and stores the file. Thatโs why Get File Properties must run after Create File, not during the upload trigger. Power Apps uploads and email attachments both need this two-step process: save first, then access thumbnail metadata.
2. Whatโs the difference between Small, Medium, and Large thumbnail sizes for AI processing?
SharePoint exposes three thumbnail sizes: Small, Medium, and Large. Large gives the most detail for documents with small fonts but uses more bandwidth. Use @{outputs('Get_file_properties')?['body/{Thumbnail}/Medium']} for cost-optimized processing or Large for maximum accuracy.
3. How do I handle different document sources (Power Apps, email, manual upload) in one flow?
Create a child flow that handles the thumbnail-processing logic, then call it from multiple parent flows. Each parent handles its specific trigger (Power Apps button, email arrival, manual trigger), saves the document to SharePoint, and calls the child flow with the file ID. This modular approach keeps intake methods consistent while maintaining separation of concerns.
๐ Related Tips
- #PowerPlatformTip 140: Free Invoice OCR, build the OCR pipeline this optimizes.
- #PowerPlatformTip 115: AI OCR Models, choose the right OCR model for your documents.
This tip is by Marcel Lehmann, Microsoft MVP (Business Applications) and founder of the Power Platform Academy – live Power Platform workshops, free or CHF 49. Join the workshop waitlist to get notified about new dates. For companies that want this implemented for them, see KMUpower – Power Platform consulting & automation for SMEs (DACH).