TL;DR: Cut AI document-processing costs 70-95% by extracting data from the SharePoint thumbnail first and only processing the full PDF as a fallback.

๐Ÿ’ก Challenge

AI document-processing costs rose sharply with the move from AI Builder credits to Copilot Credits (effective November 1, 2025). Most business documents like invoices run 15-30 pages, but the critical information sits on the first page only. Processing entire PDFs with Azure AI Document Intelligence ($30 per 1,000 pages), OpenAI Vision API ($0.01275 per image), or AI Builder wastes 80-95% of AI capacity on terms, legal disclaimers, and appendices that hold no extractable business data.

โœ… 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 platform-agnostic approach works with any AI service that accepts image input and ensures zero data loss through intelligent fallback logic.

๐Ÿ”ง 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.

๐Ÿ”ธ Reference the file ID from the previous โ€œCreate fileโ€ action.

๐Ÿ”ธ 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

๐Ÿ”ธ HTTP GET the thumbnail URL with SharePoint authentication headers.

๐Ÿ”ธ Send the base64 image to Azure AI Document Intelligence, OpenAI Vision (GPT-4o), Google Document AI, or AI Builder.

5. Validate completeness and confidence

๐Ÿ”ธ Check that all required fields are populated (invoice number, date, total, vendor).

๐Ÿ”ธ Verify confidence scores (e.g. Azure AI > 85%).

๐Ÿ”ธ If validation passes โ†’ stop here and save 70-95% of the cost.

6. Add a conditional fallback

๐Ÿ”ธ Condition: IF required fields missing OR confidence < 85% โ†’ 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 (target 85-95% for invoices).

๐Ÿ”ธ Compare monthly cost: thumbnail-first vs. full processing.

๐Ÿ”ธ Typical result: $450/month โ†’ $30-90/month for 1,000 invoices (15 pages average).

๐ŸŽ‰ Result

Organizations processing 1,000 invoices monthly (15 pages average with T&Cs) reduce Azure AI Document Intelligence costs from $450/month to $30-90/month. Thumbnail-first extraction achieves a 92-98% success rate for standard invoice formats, with intelligent fallback ensuring zero data loss. Flow execution time drops 60-80% thanks to smaller payloads. The platform-agnostic approach protects against vendor-specific licensing changes while staying governance-compliant (standard connectors only, suitable for Managed Environments).

๐ŸŒŸ Key Advantages

๐Ÿ”ธ Universal intake: works with Power Apps uploads, email attachments, or any source, just save to SharePoint first.

๐Ÿ”ธ Cost optimization: 70-95% reduction across all providers (Azure AI, OpenAI, Google Document AI, AI Builder).

๐Ÿ”ธ Zero data loss: intelligent fallback processes full documents 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: 60-80% faster flow execution thanks to smaller payloads.

๐Ÿ”ธ Standard connectors only: no premium connectors, suitable for DLP policies and Managed Environments.


๐Ÿ› ๏ธ FAQ

Q1: 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.

Q2: Whatโ€™s the difference between Small, Medium, and Large thumbnail sizes for AI processing? SharePoint generates three sizes automatically: Small (96x96px, basic OCR), Medium (400x400px, optimal for structured documents like invoices), Large (800x800px, best for complex documents with small fonts). Large gives the highest accuracy (95-98%) but uses slightly more bandwidth. Use @{outputs('Get_file_properties')?['body/{Thumbnail}/Medium']} for cost-optimized processing or Large for maximum accuracy.

Q3: 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.

Marcel Lehmann

Marcel Lehmann

Microsoft MVP Microsoft MVP

BizzApps MVP from Switzerland ๐Ÿ‡จ๐Ÿ‡ญ - PowerPlatform Expert & Evangelist & MVP - Turning passion into expertise

MVP since 2023 โ€ข Power Platform Expert since 2017