<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=612681139262614&amp;ev=PageView&amp;noscript=1">
Skip to content

Need help? Talk to an expert: phone(904) 638-5743

Automatically Save Email Attachments to OneDrive with Power Automate

Automatically Save Email Attachments to OneDrive with Power Automate

Jonathon Silva from Pragmatic Works walks viewers through an efficient way to automatically save email attachments to OneDrive using Microsoft Power Automate. This tutorial focuses on creating a cloud flow that intelligently sorts attachments based on whether the sender is inside or outside of the organization.

 

Setting Up the Trigger

Jonathon begins by explaining the importance of choosing the right trigger for the flow. In this example, the trigger is “When a new email arrives”. Key points include:

  • Include email attachments in the flow.
  • Only target emails that actually contain attachments to reduce unnecessary processing.
  • Optionally, apply a subject filter to only capture emails with certain keywords.

Defining Conditions

Next, Jonathon adds a condition to differentiate between internal and external emails:

  • Use the sender’s email address to identify internal emails (e.g., containing “pragmaticworks.com”).
  • This ensures that all internal emails are grouped together rather than checking individual names.

Creating Files in OneDrive

Once the condition is set, the flow creates files in specific OneDrive folders:

  1. For internal emails:
    • Create a file in the “Pragmatic Works Attachments” folder.
    • Use the attachment name as the file name and attachment content as the file content.
  2. For external emails:
    • Create a file in the “Customer Documents” folder.
    • Again, attachment name and content are used to ensure proper storage.

Jonathon emphasizes the use of “Apply to each” to handle multiple attachments in a single email, ensuring each attachment is saved individually.

Renaming Actions for Clarity

For better organization and readability, he recommends renaming actions within the flow:

  • “Apply to each email attachments from pragmatic”
  • “Create file in Pragmatic Works attachments”
  • “Apply to each email attachments from outside customers”
  • “Create file for customers”

Testing the Flow

Jonathon demonstrates testing the automated flow in two scenarios:

  1. Sending an email from an internal address:
    • The flow correctly detects the sender as internal.
    • The attachment is saved in the “Pragmatic Works Attachments” folder.
  2. Sending an email from an external address:
    • The flow recognizes the sender as external.
    • The attachment is saved in the “Customer Documents” folder.

Both tests confirm that the flow works seamlessly, automatically sorting attachments based on the sender’s domain.

Key Benefits

  • Eliminates manual saving of email attachments.
  • Keeps internal and external attachments organized in separate folders.
  • Reduces human error and increases workflow efficiency.
  • Can handle multiple attachments in a single email effortlessly.

Conclusion

Jonathon Silva concludes by highlighting how Power Automate can simplify everyday tasks and improve productivity. By setting up a cloud flow as demonstrated, users can ensure all email attachments are automatically organized in OneDrive based on whether they originate from inside or outside the organization.

Don't forget to check out the Pragmatic Works' on-demand learning platform for more insightful content and training sessions on Power Automate and other Microsoft applications. Be sure to subscribe to the Pragmatic Works YouTube channel to stay up-to-date on the latest tips and tricks. 

Sign-up now and get instant access

Leave a comment

Free Community Plan

On-demand learning

Most Recent

private training

Hackathons, enterprise training, virtual monitoring