Recently I was asked if it is possible to collect emails from a mailbox and store the email details in for example Excel using Microsoft Flow. Using Flow it is actually extremely easy to create an mail box as a way for people to update a data source. In my example here I will use Excel on OneDrive for Business but you could store the data in any other data store.

First I’m going to start by creating a trigger on a mail box.

When new email arrives trigger

Then I will create a table to hold the data.

create table in Excel

Then I’ll need to add a row to the table.

Add Row to Excel with columns

And finally I complete the flow by setting the data in my columns.

Add row with data

That is too simple isn’t it? Indeed it is.

When you run the flow for the first time the table will be created.  The second time the flow runs you will find that the creation of the table fails.

fail to create table

To get the above successful flow it will be needed to set the run after settings on the Add a row into a table action. You will also find that the Create table needs to be run once before  you can use the fields from the table in the Add a row into a table action.

So how should we go about this?

First create a flow that just runs the Create table action (or of course you could create an excel with a table manually in Excel Desktop). Then after that create the above shown flow without the create table action. resulting in the following 2 steps:

Small

Now you can adjust the flow to add more fields depending on what you need.

 

Avatar for Pieter Veenstra

By Pieter Veenstra

Business Applications Microsoft MVP working as the Head of Power Platform at Vantage 365. You can contact me using contact@sharepains.com

6 thoughts on “Collecting emails and storing details in Excel using Microsoft Flow”
  1. This is great. Possible to store data using flow after user inputs values using adaptive cards?

  2. I did this and the emails do get sent to excel, but they get sent in HTML gibberish! Any way to have them formatted to plain text as part of the flow?

    Thanks

    1. HI William,

      You couldn’t have asked this question at a better time.

      There is now a HTML to Text conversion action in Power Automate. It is still in preview but it does an ok job for simple html.

      HTML to text

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from SharePains by Microsoft MVP Pieter Veenstra

Subscribe now to keep reading and get access to the full archive.

Continue reading