Microsoft’s Flow is a web based automation service for many apps including a couple of client side apps like Excel. Flow works by waiting for a ‘trigger’ event and then performs some preplanned actions that can be simple up to very complex. We will be taking a brief surface level view of a simple flow.

I was introduced to this program and decided to poke around some of its functions. For myself, I learn by doing so I created a Flow that triggers on a new email received in Outlook.

To the right you will see that I have created a triggering event that will perform the next step based on the criteria shown.

Of note is ‘Subject Filter’. For this example I decided to use an example of a way to assign projects to people via Email and have this information tracked via an Excel spreadsheet.

When a user recieves an email with the trigger word (ie Assignment X0425-AS6) the below action will commence.

Firstly, an online storage location for the Excel file is needed.

Secondly, the Excel file must have a table to populate. My example table has the columns as shown to the left.

There is a variety of ways to populate the spreadsheet, (1) plain text, (2) Dynamic Content, (3) Expressions.

Dynamic Content is content that is gathered from the process that are in use within the flow, these are shown in blue to the right. This allows for easy access of basic information.

Next is Expressions. This is will be a more advanced level of gathering data in which a native expression language is required. Please note that expressions can use the Dynamic Content available as well! Expressions are shown in magenta.

First, A look at the email that is being used for the example:

A template was created and is used to pass data to the spread sheet.

I set the template up so that needed data could be gathered programmatically. This is accomplished by placing a known character to search for, this example uses a period as an ‘anchor’. A better choice for an ‘anchor’ is a special character such as ¤ (ALT+0164) so that there is a smaller chance of finding the ‘anchor’ erroneously.

You can now see, a majority of the data gathered in the previous step comes from the text in the email. Lets explore a way to get that data parsed from the text of the email.

We will be looking at the expression;

last(split(replace(first(skip(split(triggerBody()?['Body'],'.'),3)),'<br>',''),':'))

If you are unfimaliar with coding that probably makes little sense. Let’s break it down into its parts working from the inside out.

triggerBody()?[‘Body’] This is the first expression that returns the body of the email that triggered the event.

split(triggerBody()?[‘Body’],’.’) Now we split the email up by looking for the ‘anchor’, a period for this example. This returns a collection of items.

skip(-See Above-,3) We need to skip a number of entries of the collection above. This will return a new collection. This is the variable that will be used to select which data pair to use. Please note a data pair is VarName:VarValue. The variable integer is the index of the needed data pair + 1.

replace(first(-See Above-),'<br>’,”) Two actions here; 1) FIRST returns the first element of the referenced collection, 2) REPLACE is used to replace a text string with a new string. Here I am removing the line break from the HTML email body.

last(split(-See Above-,’:’)) Two actions here; 1) SPLIT splits the text string by the anchor ‘:’. This seperates our data pair into 2 values, 2) LAST returns the last element (VarValue) in our data pair collection.

Expanding On This Example:

Utilizing other Flows you can also read and update information from the referenced spreadsheet. I can see a great project managment tool arising from this example where productivity and profitability can be quantified, tracked, and utilized to address issues such as looming deadlines or production rates.

A Better Way

I spent only a few hours with this app but I can allready see much better ways to pass information than the text example provided here however this is an effective quick example.

Flow’s native data format is JSON. Had I wanted to flesh this project out I would have written a GUI to compile a JSON file and send the email from that GUI so that FLOW could have direct access to the data.

Beyond a better data format, FLOW also has the capability for .Net coding (my time did not allow for exploring this capability at this time).

Limitations

From my brief exploring it seems that only online apps can be automated and beyond that, only certain actions and triggers are supported by default. This seems to be somewhat of a WordPress approach to programming and I found myself wishing I had a nice large editor when working with the expressions.

I believe this app is geared towards supplying simple, wide audience level automation.

If you are used to automating through code you may find this approach limited as a total solution however I can definitely see where using FLOW may speed creation of automation routines by utilizing existing methodology over writing custom solutions.