Microsoft published UI Flows late in 2019 as part of the Power Platform. UI Flows are Microsoft’s take on Robotic Process Automation (RPA) with one version for automating desktop applications and another for web-based applications.
For those familiar with the Dynamics 365 Finance & Operations (D365 F&O) Regression Suite Automation Tool (RSAT), there will be some familiarity with the web-based version, given its dependence on Selenium.
Create Web Flows
To start with either version, you first install the prerequisite components on your machine. They include a UI flow app, the Selenium browser extension (for Chrome and Edge), and the on-premise gateway. The installation process is documented here: https://docs.microsoft.com/en-us/power-automate/ui-flows/setup.
The recording process is straightforward. Log in to Power Automate, select My Flows, then UI Flows, then New. Select Desktop app or Web app, give the flow a name and base URL for the web site, and then launch the recorder. The below video shows creating a UI Flow in D365 F&O to update a customer’s credit limit.
To automate this, we might want to feed in a list of customers, new credit limits, and then call the UI Flow to update each customer. To do this, we create a new Power Automate flow, add actions to read records from a table in an Excel document via OneDrive, and then use a ‘Apply to each’ loop to call our UI Flow.
Before we get to passing parameters from the flow to the UI Flow, let’s test it. If your gateway is configured, a few seconds after your flow starts, a command prompt window will open on your desktop, and launch a browser (Chrome or Edge). It will navigate to the D365 F&O URL, be redirected to the login page, and stop. And this is where our problem lies.
We can’t log in. When the Selenium extension runs, it runs under the current user account (you) BUT uses a temporary user profile in the browser that obviously has never logged on to D365 F&O before. We could edit our recording to start from the login page, but that would then involve saving our password in plain text as a recording step, and hopefully you are also using multi-factor authentication, which is noted as not being supported by web recordings (see all limitations here: https://docs.microsoft.com/en-us/power-automate/ui-flows/create-web#limitations-and-known-issues-for-web-ui-flows).
So, where does that leave us? While we can’t yet use UI Flows to interact with D365 F&O directly via the web client, we can still use flows with D365 F&O to read and write data, and UI Flows with other web/applications.
Create Desktop Flows
As a simple example, let’s say we want to get a list of customers from D365 F&O via an OData query in Power Automate and create a new Excel for each customer, via a Desktop UI recording.
The first thing we need to do is record the process we want to automate. Starting from My Flows, we create a Desktop UI Flow this time. Note we are given the ability to enter inputs for the flow. We’ll use these to store the current customer and customer group we’re receiving from our OData query.
Just like with the Web UI flow, we can test the recording also. I also update the customer account value to generate a new file, rather than overwrite the one I just created.
Now we are ready to incorporate the Desktop UI Flow with our main Flow. The steps it will execute:
- Query all customers from our selected instance of D365 F&O (I’m applying a filter in the video for one account to keep it short)
- For each record returned by step 1 – Call our Desktop UI Flow, which will create one Excel document per customer record returned.
To recap, UI Flows aren’t ready to interact directly with the D365 F&O app. But we can pair OData actions with UI Flows in Power Automate to link applications together that wouldn’t otherwise be able to talk to each other.
Have any questions about UI Flows? Don’t hesitate to contact us at any time!
UI Flows – https://flow.microsoft.com/en-us/ui-flows/
Docs – https://docs.microsoft.com/en-us/power-automate/ui-flows/overview