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.
Then I will create a table to hold the data.
Then I’ll need to add a row to the table.
And finally I complete the flow by setting the data in my columns.
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.
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:
Now you can adjust the flow to add more fields depending on what you need.
This is great. Possible to store data using flow after user inputs values using adaptive cards?
For adaptive cards and flow please have a look at the following article:
https://flow.microsoft.com/en-us/blog/adaptive-cards-for-microsoft-teams-microsoft-flow-us-government-now-available/
Is there a way to have the Flow iterate through historical emails (ie. emails in the mailbox PRIOR to the activation of the Flow)?
you could create a flow that collects all existing emails using the get emails action
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
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.