Blog Post 1 of 5: How to Set-up a Power Automate Flow
I’ve been a CRM System Administrator since 2004 and have written hundreds of workflows. Recently I had the opportunity to build a data audit system that utilized a Power Automate flow at the core. I had to search and learn a lot, and thought I’d share my learnings, from the point of view of a CRM System Admin just learning Power Automate.
Where do I begin?
First, let me just say I think Power Automate is awesome. It has some annoying quirks still, but the overall user interface designer is intuitive, and the engine is very powerful, although slower to process tons of records than say, Scribe. Power Automate has built in connectors to most of the systems you may want to integrate with. This document will describe ways you can work with Dynamics 365 CRM data stored in the good ol’ CRM/CDS/DataFlex/DataVerse repository.
How do I write my first Power Automate flow?
Alright, let’s get right to it:
- (1) Navigate to a D365 development environment you have access to.
- (2) Click on the ‘hamburger’ ‘App launcher’ icon to open the list of apps
(3) In some instances, this will just show you the list, and you can select Power Automate.
In some cases, the O365 main page opens up. Depending on what you have installed, you can just select Power Automate from the list. In some cases you must painfully place your cursor in the left hand menu, and use the down key to scroll down the list of apps and select Power Automate.
Power Apps Home Page
When you launch Power Automate you will see a bunch of marketing and educational links. You may wish to take a look, but I honestly think doing something real will be more educational for you.
On this page, click on the “My Flows” button. There won’t be any, but that is our starting point.
Let’s dive right in with a simple scenario, shall we?
Let’s assume we want to run an advanced find query against a Dynamics 365 custom entity, loop through the result set, and create a task when we find a data anomaly in our system. For example, perhaps contacts can only be linked to Active Accounts, so let’s find all contacts linked to inactive accounts. We can then create a task for somebody to investigate each Contact linked to an Inactive account.
Confusion #1: My flows are now Cloud Flows
When you click the “My Flows” button, you will see a menu of flows, including “Cloud Flows”. This used to be named “My Flows” too, but in their never-ending quest to change names for no good reason, Microsoft changed the menu inside the My Flows menu to Cloud Flows… sounds like bad weather approaching to me…
Ensure you are in the correct sandbox environment
When you first launch Power Automate, the environment may be the default environment. That is NOT what you want.
(4) Click on the Environments button on the top right of the form and select the sandbox (not the default) environment.
Start a NEW Scheduled FLOW
(5) Click the “New” button.
This will show the types of events that can trigger a Power Automate flow. The easiest one to understand is the scheduled workflow, and this meets the needs of our scenario. So
(6) Select “Scheduled Cloud Flow”.
(At least that is the name of the menu option today.) The important thing to note is that this will run on a schedule. (Don’t worry about the real schedule yet, we will invoke this flow manually when testing.)
(7) Fill out the Flow name, and select a monthly schedule, and click the Create button.
So this flow doesn’t run while I’m building it, I usually select a monthly schedule. This gives me a month to perfect the flow and create the actual schedule.
Clicking on the Create button on this page will display the canvas on which you build your flow.
First: do you have the correct control?
Depending on the Office 365 and Dynamics plans you have purchased, you may or may not have access to the Premium connector you need to be able to access D365 data.
(8) Click on the Connectors tab, and enter “Common” as your search term, and click the search icon.
You should see the connector labeled “Common Data Service (current environment)”.
If you don’t see this connector, then you need to upgrade your license to include this connector.