How to save attachments from an email in Outlook to SharePoint

The advent of Power Automate or the erstwhile Microsoft flow have completely changed the way customers and consultants approach a requirement. Prior to Power Automate, integrating across systems even if they are from Microsoft stack, would pose a challenge and customers would rethink considering the budget and implementation time. But now things have become really simpler.

And we are going to describe one such requirement here. This blog will touch on the below topics.

  • Extract attachments from an email in outlook and save it to SharePoint folder.
  • Extract attachments from an email in outlook and save it to One-drive location.

In this example I am going to show the example with SharePoint. However the same concept you can apply for one-drive. Let’s start with designing the flow.

Here I have used the “When a new email arrives” trigger of Outlook. Whenever a new email arrive in inbox, I am going to extract the attachments of the email and place it inside the SharePoint folder. Observe for the below trigger, I have set – “Only with Attachments” option to Yes.

In the next step, I create a folder for storing attachments of this email. I create a folder with the same value as MessageId. I have previously created a document library named – Email for storing all email attachments. You can create a folder with any name you like. MessageId is obviously not a great choice!

Now comes the most important final step. Iterate through all the attachments and create the attachments as file inside the folder created in earlier step.

I save the flow and when I send an email to the monitored mailbox, attachments are stored in SharePoint.

Hope this helped!

You will also like the below posts

Debajit Dutta
Business Solutions MVP


Discover more from Debajit's Power Apps & Dynamics 365 Blog

Subscribe to get the latest posts sent to your email.

Discover more from Debajit's Power Apps & Dynamics 365 Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading