blog-post

Zapier Email Parsing

author image

Introduction

The other day I ended up using Zapier’s email parser to solve a problem and I thought it was worth posting an example of how it can be used here. This is not the problem I was solving but is an example of what it could be used for.

Scenario

  • You want a log of backups taken as a form of audit in a shareable location.
  • If something goes wrong you want a notification that is not an email.
  • You want a task created to check things when a backup fails.

Preparation

First off you need your shareable audit log, you could use Airtable for this and it would actually be easier to get the data into; however, we want to do the other steps so we are going to use a SharePoint list.

In this example we will go a step further and we will create a Microsoft Team for the people responsible for the backups and then everything can be done from within that Team.

After creating your team you need the list built with the columns you want to use from your notification email.

The final part of this preparation work is to create a Microsoft Plan attached to the team. We will then create a plan item for every failed backup to track the progress of resolution.

Zapier

Email Parser as a trigger For the next stage, we need to jump into Zapier. We are going to create a new Zap using the email parser as the trigger application and new email as the trigger. If you’re reading this, you probably don’t have an email parser account so just follow the prompts until you do.

You now create a new Mailbox and grab the email address - switch to your backup system and add the generated email address of your new mailbox to your email system, telling it to send backup notifications. With this done, get your backup system to send a notification email and switch back to the Zapier Parser were you should find it showing you the email. Go through the email highlighting the information you want and giving it a suitable name. When you are happy you need to go back into the Zap you are building.

Example of parse output

Example of parse output

Select your new mailbox from the list and continue. Test your trigger and it should pull in the information from your test email. If you scroll to the bottom you can see your parse output.

When you continue from here you move into the action phase. Now unfortunately you cannot go straight into a SharePoint list so the way I find best to get this information into a SharePoint list is to create a json file containing the data that you can then parse in Microsoft Flow.

I like to create a folder in the OneDrive I am going to use but realistically you don’t need to as we are going to delete the file as soon as it’s been processed.

In your Zap, select OneDrive for the action app and Create New Text File as your event.

Choose the OneDrive account you want to use (or sign into a new one).

Select your folder (if you are using one) and then fill in what you want in the text file:

Remember we are using a json parser to pull the information from this file so all we need is for that parser to recognise the formatting in the file we are creating.

Example of file generation format

Example of file generation format

Finally give your file a name: I like to use a description followed by the date. We are now ready to continue. If you test and continue, it should create a new file in your OneDrive, so check that and then make sure you Turn your Zap On.

Microsoft Power Automate

The final stage of this process is completed in Microsoft Power Automate. Create a new flow - Build Your Own Automated Cloud Flow is the option we will use. You want to find the When a file is created trigger.

If you are using a business OneDrive then make sure you select the relevant option. OneDrive from business selection

Select the folder you want to monitor. The next step is to parse the file that was created so add a parse json action. In the content box select File content. Open your test file from OneDrive and copy its contents. Click _Generate from Sample_and paste the contents and click Done. This should re-write your very simply written file into something a little more complex, but the important thing is it gives you things to ‘Map’ in later steps.

Before we go any further we have to work out if the back up has failed or not as our list of following actions will be different depending on this factor; we can use a conditional control to do this.

The conditional Control

Before we go any further, we have to work out if the backup has failed or not as our list of following actions will be different depending on this factor; we can use a conditional control to do this.

We now have two paths in our automation: one for a successful backup and one for a failed one. Both are going to add an entry into our backup log; however, the success path will end there and our failed path will continue.

In the failed path we want to create a task in the Backup Managers Planner - we may also want to assign that to people. We could even do an additional conditional control to assign the task based on the backup source.

The last stage is to add a notification that can be seen by all the ‘Backup Managers’ and we will use Teams for that. There are lots of options we could use at this stage from sending an adaptive card to a simple chat message or even schedule a meeting to discuss resolution of the failed backup.

The final stage is to delete the file we created in OneDrive using the delete file OneDrive action.

The Power Automate section could change as required, adding or removing steps. I use OmniFocus as my personal task manager so I often set an action to mail a task into that. Or you may want to send an email to someone from a 365 shared mailbox which can also be done.

As always reach out to us if you would like more information.

Recent Articles

blog-post

My Top 10 Mac apps - Summer 2021.

MindNode MindNode is my current mind mapping software. Whether for quick outlines or working through complex projects, I …

blog-post

Microsoft Calendar Board

Microsoft is in the process of rolling out a new view to their web version of Outlook - they are calling it ‘Board’ and …

LimeZebra IT

Making Technology Work for You!
Contact us for a free initial consultation to see how we can help.

Contact Us
*