Adding emails to SharePoint lists
- benhaguenz
- May 11, 2021
- 2 min read
If you have users who need to be able to monitor an email account, but who aren't licensed for email, or if you want to show the contents of several inboxes in one place, while still being able to see where the emails came from, then one possible option is to use Power Automate flows to put emails into SharePoint lists.
In this example setup there's a main suppliers shared mailbox, and each supplier has their own shared mailbox to archive emails. Emails then come in to distribution lists and go to the main suppliers mailbox as well as the individual supplier mailbox. This isn't the only way to do it, you could also have a simpler system where emails go straight to supplier mailboxes. As long as emails end up in individual mailboxes this method should work.
The first step is to give the account you're using to set up the flow access to the mailboxes, and then create a SharePoint list to receive the emails.

Supplier is a Single line of text, date is a Date and time, Title is a Single line of text and Email Body is Multiple lines of text. Make sure you turn Use enhanced rich text on.

I enable Attachments in Show/Hide columns and then the flow user must also have permissions to create items.
Now that the source and destination are configured we can create a flow to move items from one to the other. This is an automated cloud flow that will trigger when an email is received.

The second step is to create a item in the SharePoint list based on the email. Supplier should be changed to something appropriate.

That gets the basic details in there, but it's nice to have a copy of the email to refer to, especially as copying the email this way doesn't include any of the images.
First we export the email.

And then add it as an attachment:

Adding .eml to the file name just allows Outlook to open it automatically.
The next step is to add any attachments of the email as attachments of the list item. To do this we loop through all the attachments, adding each one in turn.
The final flow should look like:

This doesn't run instantly once an email has been received, it can take 10-15 minutes. To extend it to multiple suppliers you need to create a mailbox and flow for each supplier. I do have a way to automate this, which I'm intending to include in a future post.
Comments