Power Automate – Robotic Process Automation

By Dipak Shaw

January 13, 2022


AZure, Businss Apps, Microsoft News, Office 365, Power Apps, Power Automate, Power Platform, Robotic Process Automation, RPA

This post is originally posted here

In this blog, we will discuss the Robotic Process Automation (RPA) in Power Automate.

In year 2020, Microsoft announced a new technology within Power Automate called RPA (Robotic Process Automation).

Before discussing the Power Automate RPA, let us talk about what is RPA and why we use RPA in a real scenario.

What is Robotic Process Automation?

“RPA is an advanced form of business process automation that can record tasks performed by a human on their computer, then perform those same tasks without human intervention. Essentially, it is a virtual robot copycat.”

–Marcel Shaw, federal systems engineer at Ivanti.

Why should we use Robotic Process Automation?

Many enterprises use legacy, On-Premises software for their daily use. They cannot switch to another application, nor they can use API automation with their application.

They can automate their processes and exchange data with their legacy, on-premises software.

This UI-based approach turns manual tasks into automated workflows by recording and playing back human-driven interaction with software systems that do not support API-based automation.

Types of Robotic Process Automation in Power Automate?

  1. Attended RPA: Runs on a worker’s PC to automate cumbersome or repetitive processes, allowing the worker to correct any errors as needed. This approach achieves many benefits of automation while allowing for human intervention when human intelligence or business experience is required.
  2. Unattended RPA: Runs with no user logged in. Workflows trigger in the background based on events that happen and then run at any time in the cloud. It is used to accelerate the automation of high-volume, repetitive tasks without lifting a finger.

How to use RPA in Power Automate?

In this demo, we are going to use the Contoso Invoice legacy app. Every time we will manually trigger the flow and provide inputs that will be filled by Power Automate Desktop into the Invoicing app.

Figure 1 Contoso Invoice App

Step-1) For using RPA, you must download two applications – click to download.

Step-2) Install the above two applications and log in with your account in On-Premises Data Gateway. This application works as a bridge to connect the Power Automate web to the desktop.

Figure 2 On-Premises Data Gateway

If you have already a gateway setup, you can use your existing gateway else you can create a new gateway.

Step-3) Now, we’ll create our desktop flow that will be used to perform our action over the legacy app. But unlike the normal flow actions, this time we will define the flow actions by recording our action on the desktop.

Open Power Automate Desktop and click New Flow and give your flow a name e.g., “Create New Invoice” and click Create.

Figure 3 Creating new desktop flow

A new window will open with lots of actions in the left panel, top panel, and on the right side, variables.

Figure 4 New flow window

The above both red marked options are for recording human interaction and the difference is –

  1. Web Recorder: This UI recorder is used when you want to perform any action in your web browser. E.g., opening a website and doing some tasks, etc.
  2. Desktop Recorder: This UI recorder is used when you perform any task on the windows app that is installed on your machine. E.g., windows form app, etc.

In this demo, we will use the Desktop Recorder to record our interactions from the very beginning (starting the app adding new data, and then closing the app).

Click the Desktop Recorder and follow the below video.

Our actions are recorded in the flow now we’ll create 3 variables and place them where we wrote the 3 fields value manually so that it can take input from flow and write it in the app.

To create variables, click  on the right side of the flow editor under “Input/Output variables” you will see two options (Input/Output). Select Input as this will take input as a parameter and then use it to replace action in the flow.

Enter the variable name & external name to the field’s name i.e., AccountName, PrimaryContact & ContactEmail.  And the data type will be text.

Figure 5 After creating variables

Variables are created now we will insert the variable into our UI flow’s action where we wrote the text manually.

The three actions have shown above need to be changed with the variables that we created.

Double click on each action –

Delete the text, click on , and select the variable. The first action should have the variable “AccountName”, followed by “PrimaryContact” and “ContactEmail” into the second and third action, respectively.

After assigning the variables the flow will look like the below picture –

Our desktop flow is ready now. Click Save icon to save the flow. Close the window.

Step-4) Now, we will create a cloud flow and connect the desktop flow with it. So go to https://flow.microsoft.com and click Create on

Figure 6 Power Automate Web

Now give your flow the name “Contoso Desktop Invoice”, select the “Manual trigger a flow” trigger and click Create.

Figure 7 Creating web flow

Add three input parameters in the flow trigger just like in the following image –

The user needs to submit these parameters while triggering the flow.

*Note: For the demo, I am using the manual trigger, but you can use your trigger according to your business need. E.g., When an item is created, PowerApps button flow, etc.

Now click + New Step to add an action. Search Desktop and select “Run a flow built with Power Automate Desktop”.

For the first time only, you must configure the connection with the On-Premises Data gateway to access the flows created by the desktop app.

Select the following and click create –

  • Connect: Using an on-premises data gateway
  • Gateway Name: the gateway that you created in step 2.
  • Domain and Username: Username used in the gateway.
  • Password: Password of the domain.

Note: While connecting make sure your On-Premises Data Gateway is open in windows and looks like the below image.

Figure 8 On-Premises Data Gateway is Connected

After Connecting with the gateway your flow action will look like the below picture.

Select the following –

Desktop Flow: Select your desktop flow from the dropdown.
Run Mode: Attended
AccountName: “AccountName” dynamic ontent.
PrimaryContact: “PrimaryContact” dynamic content.
ContactEmail: “ContactEmail” dynamic content.

After selecting the parameters, the action will look like the below picture.

The basic flow is ready and it will look like this.

Save the flow. Now we will test the flow by clicking on the Test option and then selecting the Manual. After that provide some details in the fields.

Here is a video of testing the flow.

More Info

For more information about Power Automate – RPA click here

Conclusion

Well, this is the end of this post. Using the above process, you can configure and use the Power Automate Desktop RPA feature with your legacy app to automate your daily tasks.

Let me know if you have any queries or suggestions in the comment below. I will see you next time, till then Happy coding!

Leave a Reply

Your email address will not be published. Required fields are marked

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}