Save Email Details In SharePoint Online List Using Microsoft Flow

In this article, we will see how we can store email details like an email subject, email body, sender's email address, etc. into our SharePoint Online custom list.

Prerequisite

  • An Office 365 subscription with SharePoint Online
  • An email account configured in outlook 365

Business requirement

Let us assume that we have a requirement that whenever any email is received by an Outlook Office 365 mail account then the email subject and body should be stored into SharePoint custom list. In order to achieve this we can use Microsoft Flow.

Let's go step by step

Step 1

Create a custom list in SharePoint Online. In my case, I have created EmailDetails with two fields: email subject and email body.


Step 2

Login to https://flow.microsoft.com and click Setting gear icon. Click Flows, as shown in the figure.



Step 3

Now, you will have your all flows listed. Now, we have to create a new flow, so two options are in front of you, which are shown below.

  1. Create from blank.
  2. Create from template.

If you click on second option, you will have so many predefined templates but for our requirement, we are going to create from scratch. Thus, click Create from Blank.


Step 4

On the new flow screen, you will have one input control, where you have to select your first action. As we are developing flow that will run when any new email arrives, search and select “Office 365 Outlook- when a new email arrives”.



Step 5

Once you are done with  Step 4, select the folder for which you want to track the email details. Select the folder, as per your need. Here, I am selecting an Inbox. It means when any new email arrives in an Inbox folder, out flow will run.



Step 6

Click “New step” and subsequently click “Add Action”.



Step 7

Again, search your action from the action input box. Select “SharePoint – Create item”.



Step 8

Once you select SharePoint, create an item followed by asking to enter the details given in the “Site URL”. Once you enter the site URL and the site URL is validated, then all the site contents will be auto populated in List Name and you just have to select the list into which you want to save the email details.



Step 9

Now, select your list in the list name. Here, in our case, the list is EmailDetails. Once you select the list all the available columns will have an option, Add dynamic content. Once you click the Add dynamic content link, you will have all the available details like Body, Subject, From, To etc. Select the details.



Select appropriate details, as shown below.



Step 10

Now, compose a test email and send that mail.



Step 11

Check your inbox and then check your SharePoint list EmailDetails. You will find the details saved there.


If you have any questions or queries regarding this article, please comment.