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.
- An Office 365 subscription with SharePoint Online
- An email account configured in outlook 365
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
Create a custom list in SharePoint Online. In my case, I have created EmailDetails with two fields: email subject and email body.
Login to https://flow.microsoft.com and click Setting gear icon. Click Flows, as shown in the figure.
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.
- Create from blank.
- 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.
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”.
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.
Click “New step” and subsequently click “Add Action”.
Again, search your action from the action input box. Select “SharePoint – Create item”.
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.
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.
Now, compose a test email and send that mail.
Check your inbox and then check your SharePoint list EmailDetails. You will find the details saved there.
Any question or feedback or suggestion, please do comment and let me know.