Reader small image

You're reading from  Workflow Automation with Microsoft Power Automate - Second Edition

Product typeBook
Published inAug 2022
PublisherPackt
ISBN-139781803237671
Edition2nd Edition
Right arrow
Author (1)
Aaron Guilmette
Aaron Guilmette
author image
Aaron Guilmette

Aaron Guilmette is a Senior Program Manager with the Microsoft 365 Customer Experience, helping customers adopt and deploy the Microsoft 365 platform. He primarily focuses on collaborative technologies, including Microsoft Teams, Exchange Online, and Azure Active Directory.
Read more about Aaron Guilmette

Right arrow

Introducing Robotic Process Automation

As you’ve seen so far, Power Automate is an extraordinarily capable cloud automation platform. While Power Automate’s focus had originally been to integrate cloud services through the use of REST API interfaces, Microsoft recognized a gap and released its tooling for robotic process automation (RPA) flows in mid-2020.

Originally named user interface (UI) flows, RPA flows are designed to capture and replay operations performed by manual intervention, such as data entry via keyboard and mouse clicks. RPA flows can help automate tasks where no scripted or API interface opportunities exist. Common examples might include:

  • Duplicating data entry into multiple systems through copy and paste
  • Reading handwritten order forms and translating them to an application
  • Performing a series of keyboard presses or acknowledgments for legacy machinery

Each of these scenarios presents different types of challenges...

Technical requirements

In addition to Power Automate licensing, this chapter will use the following software and applications:

  • Power Automate Desktop (also called Power Automate for desktop)
  • Microsoft Access
  • The Microsoft on-premises data gateway

In this chapter, we’ll be using the edition of Power Automate Desktop that ships with Windows 11. Power Automate Desktop is also available as a free download for Windows 10, which we’ll cover in the Configuring prerequisites section.

Microsoft Access is available as a standalone app or as part of a suite, such as Microsoft 365 Apps for Business (formerly known as Microsoft Office 365 ProPlus) or Microsoft Office 2019. If you have a Microsoft 365 trial tenant, you can download an evaluation version of Microsoft 365 Apps from the landing page.

The Microsoft on-premises data gateway, like Power Automate Desktop, is available at no charge from inside the Power Automate web portal. We’...

Learning about actions and variable passing

In this chapter, we’re going to introduce a few new concepts that relate to working with Power Automate Desktop, specifically around the action to run a Power Automate Desktop flow and how to pass variables from the cloud to a desktop application.

Run a flow built with Power Automate for desktop action

The Power Automate Desktop application can’t read or use cloud triggers. Using the connectivity established through the data gateway, however, Power Automate Desktop can receive the instructions it needs to execute the flows it’s responsible for.

Variable passing

Variables are a programming construct used to store temporary information. Programmers use variables as a kind of placeholder for content that changes (or varies) when an application, script, or process is run. Through the use of a variable, an application can substitute the actual value in place of the variable during execution.

You’...

Configuring prerequisites

As mentioned earlier, this flow will require a few software prerequisites – namely, the Power Automate Desktop application and the data gateway application. It will also require an Access database.

While it is possible to complete these steps on your main computer, we recommend using a second computer (or virtual machine) for configuring, prerequisites, and running the flows. Since Power Automate Desktop will automate mouse and keyboard inputs, you may experience difficulties and unexpected errors if you try to trigger the flow from the same computer that will be executing the actions.

If you don’t have access to a second computer, you can start a no-charge Azure trial subscription (https://portal.azure.com) and provision a virtual machine. Alternatively, you can trigger the flow from another device you have access to, such as a phone or tablet.

Let’s begin!

Configuring Power Automate Desktop

Power Automate...

Configuring an RPA flow

For simplicity’s sake, we’re going to reuse the existing Microsoft Forms form that we created in Chapter 13, Working with Microsoft Forms. You can create a new one if desired, but you may need to modify the steps in the example to suit your form.

Since this is a more complex and involved flow, this process is going to be broken into a series of smaller sections.

Configuring the flow framework

In this first section, we’re going to configure a new flow to invoke an action launching Power Automate Desktop. We’ll also set up the variables.

To get started, follow these steps:

  1. On the computer where Microsoft Access and Power Automate desktop are configured, ensure the Contact Database is open with Microsoft Access.
  2. Click Create and then select Automated cloud flow. Enter a Flow name, such as Add Contact to Access Database.
  3. Select the When a new response is submitted Microsoft Forms trigger and click...

Testing the flow

As mentioned in the Configuring prerequisites section, it is recommended to initiate this flow on a device separate from the computer that will be executing the desktop flow. If possible, you’ll want to have access to both devices at the same time, so you can start the flow on one device and then watch the desktop flow execute on the second device. This will help you gather any data necessary for troubleshooting issues.

To test the flow, follow these steps:

  1. On a secondary computer, open a web browser.
  2. Navigate to the Power Automate web portal (https://flow.microsoft.com).
  3. Click My flows, select the Add Contact to Access Database flow, and click Edit.
  4. Click Test to open the Test Flow panel.
  5. Select the Manually radio button, and then click Save & Test.
  6. Open another browser tab and navigate to the Microsoft Forms portal (https://forms.microsoft.com). Select the Customer Survey form:

Figure 16.34...

Verifying the flow

The easiest way to verify a successful desktop flow completion is to watch the desktop flow execute in real time. During the execution process, you should have been able to watch the following actions take place:

  • The Microsoft Access application launch and open the Contacts database
  • The New contact button being pushed
  • Text being entered in each of the fields
  • The close button being pushed
  • The Microsoft Access application close

You can also verify the flow by opening the Contact database yourself and confirming that the data matches what you entered in the Customer Survey form:

Figure 16.36: Viewing a contact that was entered through the Power Automate Desktop flow

Finally, you can review the Power Automate run history for the flow:

Figure 16.37: Verifying data in the flow’s run history

Any of these methods confirm that your flow was created and executed. If you encounter errors or if data...

Summary

RPA has the potential to help streamline operations for legacy applications that weren’t previously candidates for automation. This is incredibly beneficial for organizations that rely on older applications that are not network-aware or use older communications protocols that can’t easily be routed over the internet.

By following the examples in this chapter, you learned how to integrate a cloud flow with Power Automate Desktop, record steps in an application, and pass variables between environments – all of which are useful in crafting desktop flows specific to your needs. By being able to pass variables into the Power Automate Desktop environment, you can simulate the process of a human interacting with an application, adding value in ways not possible before.

In the next chapter, we’re going to learn about using AI models with Power Automate.

Learn more on Discord

To join the Discord community for this book – where you...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Workflow Automation with Microsoft Power Automate - Second Edition
Published in: Aug 2022Publisher: PacktISBN-13: 9781803237671
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Aaron Guilmette

Aaron Guilmette is a Senior Program Manager with the Microsoft 365 Customer Experience, helping customers adopt and deploy the Microsoft 365 platform. He primarily focuses on collaborative technologies, including Microsoft Teams, Exchange Online, and Azure Active Directory.
Read more about Aaron Guilmette