Power Automate: AI Auto-Sort Email Files
Power Automate
Jun 1, 2026 7:08 PM

Power Automate: AI Auto-Sort Email Files

by HubSite 365 about Shane Young [MVP]

SharePoint & PowerApps MVP - SharePoint, O365, Flow, Power Apps consulting & Training

Auto-sort email attachments with Power Automate and AI, classify and extract metadata to SharePoint with Copilot

Key insights

  • This video shows two practical ways to auto-sort email attachments using Power Automate plus AI: one uses an AI Builder / GPT prompt inside a flow, and the other uses Copilot in SharePoint with autofill columns.
  • The demo flow starts with an Outlook trigger, loops through each attachment, runs an AI prompt to identify the document type, then creates the file in a dynamic SharePoint folder and updates properties via a Switch action.
  • Microsoft now favors generative AI prompts for flexible classification instead of only using older OCR / keyword rules, so AI can infer document type even when text patterns vary.
  • Key benefits include less manual sorting, faster handling of shared or high-volume mailboxes, and easier deployments because the AI prompt can be solution-aware and travel with the Power Platform solution.
  • Typical building blocks are: an email trigger, an action to get attachments, an AI classification step, and routing actions such as SharePoint create file, update file properties, or posting to Teams.
  • Practical uses: route invoices, purchase orders, or resumes automatically; extract key data into file metadata for searches and reporting; and reduce manual filing errors while keeping flows low-code.

A new instructional video by Shane Young [MVP] demonstrates practical ways to auto-sort email attachments using Power Automate combined with AI. In the clip, he builds two patterns that classify and route files from incoming email, then files them into the right SharePoint folders while populating metadata. This article summarizes the video, highlights the tradeoffs, and outlines the operational challenges organizations should expect when adopting these patterns.

Overview of the automation patterns

Shane Young presents two complementary approaches for handling attachments that arrive by email, both centered on adding a bit of AI to standard flows. First, he shows a flow that loops through attachments, runs a classification prompt, and then uses that label to determine a folder and metadata. Next, he demonstrates how to use Copilot in SharePoint to achieve similar routing with autofill columns for file properties.

Consequently, the goal of both options is to reduce manual sorting and to improve downstream automation that relies on correct file types and metadata. Moreover, the demonstrations focus on realistic business documents such as invoices, purchase orders, and resumes, so the examples map directly to common back-office workflows. Thus, the video frames the work as a way to sprinkle intelligence into flows organizations already run.

How the two methods work

In the first method, a cloud flow in Power Automate triggers when a new email arrives in Outlook, retrieves each attachment, and then sends the file or its extracted text to an AI prompt for classification. Based on the returned label, the flow creates the file in the right SharePoint folder and updates file properties via a switch action to set metadata. This method uses a prompt-style classification, which lets the model infer document type even when exact keywords are missing.

In the second method, Shane uses Copilot within SharePoint to autofill columns so that saved attachments gain the correct metadata automatically. This approach reduces the need for custom flow logic because the autofill feature can populate properties at upload time. As a result, the second option may be simpler for teams that prefer interface-driven setup over flow construction.

Demo walkthrough and practical steps

The video walks through the flow trigger, a loop over attachments, an AI classification step, and then conditional routing into folders and metadata updates. Shane also shows where to use the AI Builder or generic GPT-style prompts within a solution so the classification logic travels with deployments, which helps test and production consistency. He demonstrates how to map categories to folders and how to populate SharePoint columns so that downstream processes can consume the data.

Furthermore, the demo emphasizes incremental testing: send a few example emails, verify classification accuracy, and refine the prompt or rules as needed. This stepwise approach lets teams tune model behavior while catching edge cases such as image-only PDFs or non-English documents. Consequently, the hands-on walkthrough highlights both the mechanics and the validation work required for reliable automation.

Tradeoffs and implementation challenges

Using AI prompts offers more flexible classification than plain keyword matching, but it also introduces new tradeoffs related to cost, latency, and governance. For instance, prompt-based classification may incur API charges and add seconds to processing time, whereas simple text extraction with deterministic rules can run faster and cheaper. Therefore, organizations must balance accuracy gains against operational cost and response-time needs.

Additionally, teams face challenges around data privacy, permissions, and error handling. Attachments can contain sensitive information, so flows must enforce secure storage and proper access to SharePoint libraries. Moreover, unusual file types, low-quality scans, or incomplete metadata may produce misclassifications, requiring human review steps or fallback rules to avoid misfiling. Hence, building robust logging, retry logic, and escalation paths is essential.

Practical takeaways for businesses

In practice, the video shows that adding a modest amount of AI to existing flows can cut manual work and improve routing accuracy, especially for shared inboxes with high volume. Moreover, choosing between a prompt-based flow and Copilot autofill depends on the team’s skills, governance model, and tolerance for external AI calls. Teams that need fine-grained control and predictable costs may prefer rule-based steps with targeted AI only where rules fail.

Finally, organizations should pilot the pattern on a narrow set of document types, measure accuracy and cost, and then expand coverage gradually. In doing so, they can capture the benefits of smarter inbox automation while keeping a handle on operational risk and maintenance effort. Overall, Shane Young’s video provides a clear, practical starting point for teams ready to add intelligent sorting to their email attachment workflows.

Power Automate - Power Automate: AI Auto-Sort Email Files

Keywords

Power Automate email attachments, auto-sort email attachments, Power Automate AI attachments, save email attachments automatically, Outlook attachment automation, AI email attachment sorting, Power Automate attachment workflow, automated attachment filing