You are here
Home > This Developer's Life > Email Automation Microsoft Flow – Automating

Email Automation Microsoft Flow – Automating

email automation microsoft flow

Email Automation Microsoft Flow – I have a private email account. It is a good idea to separate your personal and work email accounts. The problem is, the emails never get easier to manage. This post will discuss the automation of an email. In particular, it will show you how to save important attachments to your Dropbox account.

If you came here for something else, try the following links:

Email Automation Microsoft Flow – make important attachments come to you

The automation software we will be using is Microsoft Flow. You will need to create an account in order to start.

Email Automation Microsoft Flow

Start by creating a new blank flow. If you need to explore other flows, you can try creating a new flow from a template.

email automation

For now, we will search for a trigger called

Email Automation Microsoft Flow select trigger

Clicking on that will display all the available triggers for Select When a new email arrives.

Email Automation Microsoft Flow new Outlook mail trigger

Email Automation Microsoft Flow – Configuring Triggers and Connections

This will add the trigger to your flow. Clicking on the three dots on the trigger will allow you to add more connections.

Email Automation Microsoft Flow configure trigger

You will now need to click on the Show advanced options link. This allows you to configure your trigger. This trigger will only act on emails from a specific email address that has an attachment. It also only acts on the email if it has a specific subject line.

Email Automation Microsoft Flow trigger settings

The next step you should take is to add a new action. Search for Dropbox and click on the Create file action.

Email Automation Microsoft Flow add dropbox action

As before, click the three dots on the action and modify your Dropbox connections. You can then select the Dropbox folder you want to save the attachment to from the folder path setting.

Email Automation Microsoft Flow dropbox connections

You now need to specify the file name for the attachment to save to your Dropbox folder. This is where Dynamic content comes into play. The steps you want to follow are marked in the screenshot below. After selecting the Attachment Name dynamic content in step 2 below, the flow will change to an Apply to each.

Email Automation Microsoft Flow dynamic dropbox content

Steps 3 and 4 are then replaced by an Apply to each. Microsoft Flow does this automatically. This is to cater for multiple attachments in your email. To continue, select the File content text box and select the Current item Dynamic content.

Email Automation Microsoft Flow dropbox file content

Once you have done this, click on the Save button. Trigger emails usually run every 15 minutes. Let’s have a look at the run history.

Email Automation Microsoft Flow Overview – Run History

Because the flow is automated and has now GUI that you can control, you need to make use of the tools in the Flow automation software to see the status of the new flow. To do this, open the flow and click on the Run History section.

Email Automation Microsoft Flow run history

Under the All runs dropdown, you can see several options available to you. Start by looking at the Checks (no new data) option. This will show you the times that the flow ran but found nothing to process.

Email Automation Microsoft Flow checking runs

Look at the time of the no new data runs and then send yourself an email as configured earlier in the email trigger. Wait 15 minutes and then check your Dropbox folder.

Email Automation Microsoft Flow flow successful

After 15 minutes, you will see the successful notification under the Successful runs history. If you see a failed entry when selecting Failed runs, then you need to see where your flow is failing.

attachment saved to dropbox

Looking at the folder where my Dropbox syncs to on my PC, I see that the statement has been saved to my Dropbox folder and synced.

Email Automation Microsoft Flow Failed

There is however a problem with this flow. It will only work with the first email it receives. Thereafter it will fail. The reason for this is because the attachment being saved to Dropbox will conflict with the previous attachment’s file name. Have a look at the article on Debugging Microsoft Flows to see how to resolve this issue.

Debugging Microsoft Flows >

Cool Life Hacks #2 – Automate Trello with DevOps and Wunderlist

The next cool life hack using simple technology hacks is automating a Trello board. I want to update my work items on DevOps as well as my personal Wunderlist to-do list. Let’s have a look at exactly how this would work.

Automate Trello >

Dirk Strauss
Dirk is a Software Developer from South Africa. He loves all things Technology and is slightly addicted to Jimi Hendrix. Apart from writing code, he also enjoys authoring books and articles. "I love sharing knowledge and connecting with people from around the world. It's the diversity that makes life so beautiful." Dirk feels very strongly that pizza is simply not complete without Tabasco, that you can never have too much garlic, and that cooking the perfect steak is an art he has almost mastered.

Similar Articles