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.
๐ 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.