Wednesday, May 4, 2016

Go with Flow: Email enabled document libraries are back in SharePoint Online!

With the new* in preview service Flow -as part of Office 365- it's possible to add email attachments to a document library in SharePoint Online, where as the standard option is not available.
This is an useful way to process files by saving them in a document library and thereby triggering a workflow for further processing.

 There's a template available to start from. First the permission to the connections must be set.

Then the logic flow itself is configured. Extra conditions can/should be added to the trigger 'On new email' to be sure that only relevant content is saved to the document library that is listed in the Folder Path.

Give the flow a name and hit the button 'Create Flow' to publish and activate it.
Now the flow is active. Take it for a test drive and send an email with attachment to the inbox.

Under My Flows there's a dashboard with a list of your flows. Click for information to show the list runs.

You can check the status of every run and zoom into it. Click on the step for more detailed info about it.

After a succesful run the email attachments were saved to the document library in SharePoint Online.

The flow could be extended with another action to set the Title field of the file via the REST API using a Http request.

* Microsoft Flow is availabe in preview and is a development that originated from Azure Logic Apps and was/is part of the (former invite-only) preview of PowerApps. With Flow it's possible to create automated workflows between different services to get notifications, synchronize files, collect data, etc. in a way of If This Than That by configuring a combination of trigger, conditions and actions.


  1. Does this only save the attachments that you send from your email? I need to set this up so that it saves attachments that ANYONE sends to the email.

    1. It should work for any email message with attachment(s) that is received in the mailbox that is monitored by Flow, based on your permissions.

  2. Does it work for SharePoint calendars as well?

  3. Hello Hans,
    I tried to use your approach filling a SharePoint Online discussion board (which is a list!) with Outlook 365 emails.
    Unfortunately something strange happens: when an email arrives, the Microsoft Flow is triggered and perform an action "Create Item" in the SharePoint list (Discussion Board), but instead to have one single item in the list, for each single email, I find myself with same email/entry duplicated many times. Did you experience something similar?
    Thanks in advance

    1. Hi Erik,

      You could/should make use of the standard integration between SharePoint and Outlook for a better result. Just connect the discussion board to Outlook and add email messages to it via drag & drop.
      This is one of the old school best kept secrets that's already available since MOSS 2007.
      About the issue with Flow I didn't try this particular scenario but since the discussion board is not a standard list the integration with flow might not be working correct (yet). It's also possible that the connection itself has hit the roof. I had a Office Group with a connection to a RSS feed that went wild; every 5 minutes I received the "new" feed. I had to remove connection to free myself from the notifications.
      Flow is still in preview, so are our business solutions ;-)

    2. Many thanks Hans for your answer.
      I think the problem is the frequency of checking for new emails. Probably I have to check only for unread mails and then flag them with a "read" flag, in order to not be read again. About the connection between discussion board and Outlook, I would like to do it automatically without manual intervention. I'm using SharePoint Online and it doesn't support email to lists (this is the reason why I'm trying to use flow).

      Thank you again,

  4. We are trying to do this (email attachments to sharepoint online) but it's been inconsistent. It's skipping some emails randomly. Anyone else experience this?

  5. i tried to use this flow for add my email attchment to sharepoint document library ...tommorow was working proper but now its skeep my email attchemnt...any one can help me to solve this issue...why this flow skiiped all email attchment ??