Tip o’ the Week 474 – Parse and Flow

clip_image001Microsoft Flow was introduced a couple of years ago, and covered in ToW #401; it’s basically a glue between different online applications, allowing the exchange of data between them and being driven by events and actions.

clip_image003Sign up, sign in, and when you go to create a new Flow, you can start with a blank canvas, or by customising a pre-built template, of which there are many.

Learn how to build Flows here.

Many of the templates for Flow are quite esoteric – when a tweet on a particular topic appears, write a log to a Sharepoint site and send a notification to a Teams channel, that kind of thing. But there are plenty of really useful connectors that can be combined in time-saving ways; here’s a really handy way of bringing traditional data sources into the modern era: an email parser, called Parserr.

After signing up with Parserr – free if you only need a few uses per month – you can then crack open mail that is consistent in format and contains some information you’d like to extract and use elsewhere, such as confirmation of an appointment or maybe a travel booking. In practice, you get given an inbox with a unique email address within Parserr and you’d set up a rule in Office365 or Outlook.com to send mails that meet some inbox rule to that address, where it would be parsed for you and key data fields then sent back to Flow.

e.g. if email comes from a specific source address or it has a subject that indicates it’s a particular type of reservation, then forward to your nnnnn@mg.parserr.com inbox address, extract the details of the booking then do something with them within Flow.

clip_image005Start by sending an example mail to your Parserr inbox, then you can define rules to identify content within it (by looking for set keywords, going to specific line numbers and so on).

Create a rule for each piece of information you want to extract, and it will effectively create a field:

clip_image007

Once set up, you create the Flow by choosing the connectors for Parserr and whatever other applications you need to work on the information.

In this example, we’re using Office 365 to create an appointment that matches a reservation – the arrival and departure dates are provided by the source email, and converted to YYYY-MM-DD format within Parserr, then dragged across in Flow to match the Start & End times of an “event”. We’ll tack on T16:00 to the arrival time and T10:00 to the departure as that’s the check in and check out times, and thus create an ISO8601-compliant date/time such as 2019-04-05T08:00, which Office365 will use as the start or end time of an appointment.

“Advanced options” gives you further control (such as adding body text that might contain static text and other fields provided by Parserr, other addresses to forward the invite to, setting if you want it to be free/busy/tentative, reminder duration, time zones etc).

clip_image008

And that’s it: you can test the logic is working within each system – in Parserr, you can continually re-run the processing of your initial sample mail until you know the data is being extracted as you’d like, and within Flow you can keep testing your formatting etc by clip_image010either triggering a new input or by working with the last set of data that came over from the source. 

Once you’re happy just save the Flow, and it will automatically create an appointment in your calendar every time you get a matching email forwarded to the Parserr system – all in a few seconds.

See more on using Parserr with Flow and here’s a worked example.

Tip o’ the Week 401 – Go with the Flow

We all get notified of stuff that we’re probably interested in, but clip_image001which we never get around to reading about in-depth, or trying out. Well, this week’s topic presents both an example of exactly that (for some of us at least) and a potential solution to it – Microsoft Flow, a free-to-use, simple*, workflow tool that can stitch all kinds of things together in a useful manner.

* some may take issue with “simple”.  Bah.

Flow promises to do all sorts of groovy things that nobody ever needs, like writing every email to a Google Sheet then sending your calendar a reminder to look at it. But there are lots of potentially interesting and useful things you can put together, either by using the many templates or by building your own custom flow based on simple logic. You could connect all kinds of disparate web-based services together and using triggers, fire off actions based on events happening – like a tweet about a particular topic, or a new event added to a calendar.

Let’s take an example – say, you have an Office 365 work mail account and associated calendar. When you put something in your calendar which is both an all-day event, and is also marked “Out of the Office”, that probably means you’ll be out of the office all day, maybe away on a business trip or possibly even on holiday.

Wouldn’t it be useful to be able to copy that to a calendar that your nearest and dearest can see, maybe even adding all the events from several family members into one place, shared with all the others?

First off, you may want to log into www.outlook.com, go into Calendar and create a new shared calendar (if you don’t have one already)clip_image003 give it a suitable name (like Family Calendar) and clip_image005then make sure you’re sharing it with the right people you’d like to be able to see it. They will get an invite to see the shared calendar and it will be added to their own Outlook.com calendar view (as pictured way below).

clip_image007

Now, to create the flow to copy stuff from your work to Family Calendar…

  • Login to Microsoft Flow using your Microsoft Account, here.
  • Create a new Flow using a blank starting point, here.
  • Search event and select Office 365 Outlook – When a new event is created (and might as well pick v2 unless you know better)
  • Next, you’ll need to sign into your Office 365 account to be able to access it. Select the default calendar (probably just called “Calendar”…). This is the source for the flow, the trigger.
  • Click New Step and select Add a condition, then click in the “Choose a value” field; in the dynamic content pop up box, type clip_image009Is all day and you’ll see an “Is all day event?” condition clip_image011appear in the list. Click to add it to the flow.
  • Check that the central drop-down is “Is equal to” and click on the value to the right and enter True.
  • In the “If yes” left-hand pane, select Outlook.com – create event, then Sign in to provide your Outlook.com credentials.
  • Choose the Family Calendar from the list, and add the relevant details you’d like to add – in other words, the attributes from the source (O365) calendar, that you’d like to reflect on the destination (Outlook.com) one.
  • It’s a good idea to show Advanced Options, and select something like the following attributes by searching in the Dynamic content box for the key fields in each case (one of the more important being Is HTML, if clip_image013you’re going to put anything in the body of the message).
  • When you’re happy, click on the Flow name box at the very top of the page and give it something meaningful, and then Save Flow to the bottom

Now you should be able to see any new, all-day events that appear in your work calendar, showing up in your shared Outlook.com custom calendar.

A further refinement might be to add a condition to only trigger the sync when the original meeting is set to “Out of Office” – click on Update flow to edit, then add another clip_image015step, Add a condition then add Show as equals 3 – that’s the field that denotes the event’s status (busy, free etc), and “3” is the value that means “out of office”.

clip_image017
Save the flow and you’ll see the flow copies only OOF events from your work calendar to your shared private one… as below, where Outlook.com is shown behind the Outlook app.

clip_image019

It’s worth having a play around with Flow, as you can do some interesting things with it (and there are connectors for all kinds of services, including Google mail & calendar, Wunderlist tasks, even grown-up apps like Dynamics or Salesforce. There are mobile apps that can take part in flows, too); do bear in mind that it takes anything up to a few minutes to fire these kinds of events, and if there’s a problem running your logic, then you’ll be notified.

It may be worth adding a debug step that can be easily removed later, by getting the flow to send you an email with the values of the fields you’re interested in…

clip_image021