cancel
Showing results for 
Search instead for 
Did you mean: 

Use Flow To Organize and Process Email Attachments

Ok, here's a post to piggy-back off of my post regarding inbox sweep rules!

 

A common scenario for many organizations and users is the need to organize images or documents that are sent from external sources.

 

How can you organize a bunch of images that someone is sending you from an event without having to train someone to use a new app and login to Office 365?

 

How do you take that document that a user sent you, get it into SharePoint or Teams with the proper metadata/properties?

 

The answer is this quick and easy Flow, which will allow you categorize and move attachments into Document Libraries and add identifying metadata as part of the process. Using the sweep rules in an email inbox, you can manage and sort the emails and attachments in one simple process, and also use sweep rules to clean up the emails as they get stale if you so desire. By using Sweep Rules in combination with folders in Outlook and Document Libraries in SharePoint or (/Office365 Groups or Microsoft Teams), you can be very specific as to how attachments can be sorted and labeled as part of this process.

 

For event images for instance, the filter can be based on the hashtag for the event, or for any use case you can simply use a unique character string. I always recommend using a symbol of some kind like an _ or * or ^, like if someone includes ^contract in the subject the attachment will be routed to the Contract library with the email body text in the description column. Remember for any email you can always pull the address of the sender as well as the time stamp via Flow to add more information to the destination library.

 

The only caveats to this is that for Flow to work, the attachments cannot be inserted inline with the email, they must be actual file attachments to the message- and you need to use a Document Library as opposed to a list.

 

OK, let's get started!

First, make your folders and setup your Sweep Rules as desired.

 

Image 001.png

 

Here, I've created a folder for marketing images, to receive images from people at events for our marketing team. When this email box gets an email with #image in the subject, it will send that email to the Marketing Images folder to trigger my Flow (see below).

Image 002.png

Next, setup your destination Document Library or Libraries and metadata columns.

 

For my Document Library, I've set up columns to keep track of the images that are sent.

Image 011.png

The column values for each image will be pulled from the email itself- it's important that users understand the conventions you set to make this work properly- having a specific hashtag for an event that goes in the subject in this instance would be a good way to keep track of things. For this example, I'll use #Image #Ignite2018

 

For my Microsoft Team attached to this group, I'm going to add a channel tab for this library too, so it's easy for people to see the new images and control notifications about them as well.

 

Image 003.pngImage 004.pngImage 005.png

 

Now, it's time to get into Flow and make the magic happen!

 

I'll start with the trigger in Outlook, "When a new email arrives" and choose the "Marketing Images" folder I made with my sweep rules. It's very important to also set the "Include Attachments" Option to "Yes" Then I'll need to use the "Get Attachment" action, so I can isolate the email attachments. It's important to note again here, that this will only work with actual message attachments, not images that are put inline into an email.

Image 007.png

 

Flow will add the "Apply to each" container around this action to capture all the attachments in a given email.

  

Set the flow to create a new file in a Document library based on the criteria you've chosen- and use email data to add metadata to the columns in your library.

Image 012.png

Now test your Flow!

 

Image 013.png

...and here it is in Teams!

teams.jpg

Well, I'm really excited for when Teams finally has all the metadata display capabilities of SharePoint, which has been conifirmed as being the intention of MS-but in any case...

 

SUCCESS!

 

When I send an email with attachments that has #image #Ignite2018 in the subject, the email is routed to the proper folder, and the information within the email is added to the images that show up in the Document Library. I can also now easily see and interact with those images in Teams, because I added the library as a channel tab to my Marketing Team. When testing this, I also discovered that it can be tricky to try and use the body content of an email for Metadata, as Flow will attempt to pull all the HTML from the message- so basically don't do this. Just pull the information from the Subject line for your file sets, and make sure that your teams are properly educated on naming conventions! I personally have used this for the same use case above, and also to record check deposits along with the customer name and subject for each check.

 

It's also easy to update the Document Library as time goes on if you need to organize or clean up your data in the future. 

 

Remember this can be so much more than just images- it really can work with any email attachments. Also, you can make many Flows based on different folders within an Exchange mailbox, and this will work with all the attachments witinin an email- which means that you can really mitigate how many Flows are kicked off. 

Meet Our Blog Authors
  • Co-founder of https://plumsail.com, Office 365 and SharePoint expert. Passionate about design and development of easy to use, convenient and flexible products.
  • Microsoft Business Apps MVP. Owner of ThriveFast, an Office 365 consulting company.
  • 7x Microsoft Business Solutions MVP (CRM)
  • Solution Architect with Slalom, and organizer of the Boston Office 365 User Group, and long term SharePoint/Office 365 veteren. Find more at http://www.davidlozzi.com. Follow @DavidLozzi
  • I'm keen in MS technologies, SharePoint, Office 365 and development for them
  • Michelle is an Office 365 solution architect in Twin Cities, MN. She has been delivering business collaboration solutions for years with her focus on SharePoint and Office 365. Michelle is a recent board member of the Minnesota Office 365 User Group and has been a member of the SharePoint community since 2009. She is a frequent speaker at MNSPUG and SharePoint Saturday and co-chaired the Legal SharePoint User Group for 4 years. Her most frequent projects have involved rolling out a large deployment of Office 365, SharePoint Online intranet, build of a "CHAMPS" Office 365 user adoption program and most recently, SharePoint On-Premise to Online Migration. Michelle is very excited about cloud technology as it is shifting her IT Pro focus to collaboration strategy and technical adoption.
  • I'm a Microsoft Office Servers and Services MVP with a special interest in SharePoint, Office 365, Microsoft Flow, Microsoft Teams and PowerApps. I work at Triad Group Plc ( https://triad.co.uk)
>