Daniel Flieger
Author
Daniel Flieger
QA Consultant

January 3, 2025

In many companies, numerous emails with important attachments arrive daily. Manually saving these files not only consumes time but also increases the risk of errors. With Microsoft Power Automate, this process can be efficiently automated, ensuring that attachments are directly saved in a defined SharePoint folder. This not only improves productivity but also ensures better organization and archiving of documents.

A Practical Example

Imagine your team regularly receives invoices, reports, or other important documents via email. Instead of manually opening each email and saving the attachments, an automated workflow ensures that all attachments automatically land in a specific SharePoint folder. This allows your team to stay focused on the essentials.

The final flow

Step-by-Step Guide to Automation

Step 1: Create a New Flow in Power Automate

  • Open Microsoft Power Automate and select "Automated Cloud Flow."
  • Define the trigger as "When a new email arrives."

Step 2: Process Email Attachments

  • Enable the options "Include Attachments" and "Only with Attachments" to ensure that only emails with attachments are processed.
Selected Steps do have a blue corners

Step 3: Create a Loop for Attachments (Foreach)

  • Add a Foreach loop to process each attachment individually.
  • The attachments are passed to the loop as parameters.
The foreach loop receives all attachments as a parameter

Step 4: Add a Condition to Filter File Types

  • Use a Condition Control to save only attachments of a specific file type (e.g., PDF).

Step 5: Save Attachment to SharePoint

  • Select the "Save File" action and specify the path to your SharePoint folder.
  • Use dynamic content for File Name and File Content: Select "Attachment-Name" for File Name and "Attachment-Content" for File Content.

Step 6: Send Notification in Teams or Email (Optional)

  • Add the action "Post Message in a Chat or Channel" to notify your team about saved attachments.
  • Use dynamic content in the Message Text field to display the sender, subject, and attachment name in the Teams channel.
Send message to teams

Automating the storage of email attachments with Microsoft Power Automate not only saves time but also reduces errors and ensures an organized data structure. By integrating SharePoint and Teams, a seamless workflow is created.

Try out this workflow in your company and experience firsthand how much more efficient your processes can become. Low-code tools like Microsoft Power Automate or Logic Apps offer numerous possibilities to automate internal processes. If you have questions, suggestions, or face challenges, we are happy to assist!