Tag Archives: Workflows

I recently attended a fascinating talk on machine learning by Martin Kearn and an implementation of this in Microsoft Flow by Mark Stokes. Did you know that there are APIs to access machine learning functionality via Microsoft’s Cognitive Services API? Did you also know that you can easily connect to these services in Office 365?

The APIs give you access to computer vision, face emotion, face detection, text analytics, translators and much more. Microsoft have really opened up machine learning to the average developer (or non-developer)!

In this blog post, I’m going to show you how to use the text analytics cognitive API in Microsoft Flow without any code at all. If you are not familiar with Flow, check out some of my earlier posts.

Starting in Microsoft Flow, search the templates for “Text analytics”. Some interesting starter templates appear including analysing text for positive or negative sentiment via Twitter, Yammer and email. The returned sentiment value can then be used to start an action or chain of events. Have you ever wanted to be alerted to a negative email from the boss? Well now there is a template for it!

In this example, I’m going to use the “Get emails for positive tweets” template. I want to get notified by email when I receive tweets which are very positive in sentiment.

From this screen, you can see that the services involved in this Flow are Twitter, Text Analytics and Mail. Select “Use this template” and sign into each service.

When you get to the Text Analytics service, you will be required to enter a connection name and account key. To get this go to the Azure Text Analytics site and sign up for a free account (if you don’t already have one) by going to Getting started.

Once you have the account setup, navigate to your account keys in the Azure portal (as shown below).

Copy and paste the account name and key 1 into the Flow connector.

In my Flow, I have used the hashtag #msflowtextanalytics as my trigger. If anyone uses that hashtag on Twitter, it will start the Flow.

I’ve left the condition as 0.7. This means if the API returns a 70% positive sentiment rating, it will send the email.

Finally, fill in the email details to complete the Flow. The template email will show who sent the positive tweet and the sentiment score from the API.

Publish the Flow and go to Twitter to test it out.

The Flow can take around 2 minutes to run but you should eventually receive an email with the name of the person sending the tweet and the score from the sentiment API.

There are many uses for this in real world scenarios. Marketing and PR departments could use a very similar template to detect any negative tweets. That could then trigger an email for manual intervention or you could automatically direct message the user and open a support ticket. It could save huge amounts of time watching and sorting through thousands of tweets manually.

There are connectors for SharePoint, Instagram, Office 365 Email, and much much more. Imagine integrating all of these separate systems into one workflow (you couldn’t do that in SharePoint Designer).

Exciting times for machine learning and very powerful tools for those of us who are not developers or data scientists.

I have made the video below on how to create a basic SharePoint workflow to send emails. This could be used for sending out remittance advice (like in the example below) but it could also be used with additional workflow logic for sending out help desk emails, renewal reminders, etc.

Hope you find it useful, please feel free to contact me at Cloud Design Box if you have any further questions. I’ll try and make a full blog post on this subject with screenshots as soon as I get chance.

Tony Phillips

I’ve been working with Microsoft SharePoint since 2003 and specialise in branding, implementation and design of SharePoint installations. I’m a Microsoft Certified Professional and graduated from The University of Derby with BSc (Hons) in Digital Entertainment. I currently run a SharePoint and Office 365 consultancy business called Cloud Design Box Ltd. I work with clients across the UK and all over the world, please feel free to contact me via the contact page if you require consultancy or via twitter for general questions.