In my last post, I explored how you can make it easier to monitor key performance indicators using Power BI alerts. In this post, I’ll take that a step further and explain how you can use Power BI alerts to trigger Microsoft Flow workflows. This simple, but powerful connection between the two services opens up a world of automation opportunity simply and effectively.
What is Microsoft Flow?
Microsoft Flow, launched in 2016, is a cloud service for using workflows to connect different applications and services together. If you’ve ever used a service like IFTTT then you’ll get the idea pretty quickly. Microsoft Flow workflows are built to make it easy to carry out many actions automatically. For instance, saving all the file attachments from your inbound email to your OneDrive, or creating a CRM case every time someone tweets your brand with a question, there are many possibilities. One way to start is to use Power BI alerts to trigger Microsoft Flow workflows.
This is my completed flow to push an alert to my mobile device and to tweet me when my connected Yucca needs watering. Let’s look at how easy this is to create.
Step One: Creating new Microsft Flow workflows and picking a trigger
As well as giving your new Flow a name, you’ll need to start searching for the trigger. In this case, I’m looking for the Power BI trigger “When a data driven alert is triggered“.
Because I’ve signed into Microsoft Flow with the same Office 365 credentials as I use for Power BI, it links the two together meaning I can pick my pre-defined Power BI alert from the list automatically. Of course, if I’m not using this configuration I’ll need to authenticate with Power BI in order to pull through my list of alerts.
Step Two: Add actions
Once you’ve configured your Power BI alert as your trigger, you’ll need to pick some next actions.
Click on the “New step” button to select the next action or condition. There are six possible options:
- Add an action
- Add a condition
- Add a switch case
- Add an apply to each
- Add a do until
- Add a scope
These options allow you to create some pretty complex workflows. For this example, we just want to add an action.
I’m actually going to create two actions: a push notification to my mobile device, and a tweet. The process for adding additional actions is exactly the same, so to save time I’m just going to cover creating a push notification.
I have a choice between an email notification or a mobile notification. Since I want this to push out a notification to my mobile device through the Microsoft Flow app I’m going with the first option “Send me a mobile notification”.
Step Three: Configure actions
Once I’ve picked the action I have to configure it. One of the cool things about Microsoft Flow is that I can pull through information from other steps dynamically into the action I’m currently configuring.
I can easily configure the text for my push notification to be set to the value of the Power BI alert title, URL, threshold, value or any of the dynamic values I’m able to pick from in the list. This makes configuring the action much quicker, and intelligent based on the value passed to it from the previous step. No code required! 👍
Once you’ve specified the fields (noting that only the text is mandatory), click “Create flow” and you’re done.
Step Four: Wait until it’s triggered!
In my example, it took a few days for me to know if this worked. Mainly because I’m lazy and didn’t want to test against some demo data. When my plant eventually needed watering a few days after I created my flow, I was pleased to get this pop up on my iPhone:
Microsoft Power BI is a great tool for visualising data and is made even more powerful by supporting the creation of data-driven alerts. Combined with Microsoft Flow (or an Azure Logic App) you can get even more value from your data. It’s simple to get started, and building far-reaching automated workflows is straightforward and Flows can even be shared with your colleagues to make management even easier, and useful Flow recipes easier to replicate between users.