Democratizing RPA with Power Automate Desktop - Peter Krause - E-Book

Democratizing RPA with Power Automate Desktop E-Book

Peter Krause

0,0
25,19 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.
Mehr erfahren.
Beschreibung

Whether you want to organize simple files or perform more complex consolidations between different Office programs and remote-control applications that don't allow outside access, Power Automate Desktop helps meet these challenges. This book shows you how to leverage this workflow automation platform by explaining the underlying RPA concepts in a step-by-step way.
You’ll start with simple flows that can be easily recorded and further processed using the built-in recorder. Later, you’ll learn how to use the more advanced actions to automate folder and file management and enable Office programs to interact with each other. You’ll also get to grips with integrating desktop flows into other cloud environments and further enhance their value using AI. As you progress, you’ll understand how flows can run unattended and how they are managed in the Power Platform, as well as key concepts such as creating, modifying, debugging, and error-handling UI flows. Finally, the book will guide you to use Process Automation Designer (PAD) in conjunction with your frequently used desktop systems to automate routine tasks.
By the end of this book, you’ll have become a Power Automate Desktop expert, automating both professional and personal tasks.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB

Seitenzahl: 336

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Democratizing RPA with Power Automate Desktop

Boost your productivity by implementing best practices for automating repetitive desktop processes

Peter Krause

BIRMINGHAM—MUMBAI

Democratizing RPA with Power Automate Desktop

Copyright © 2023 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

Group Product Manager: Alok Dhuri

Publishing Product Manager: Uzma Sheerin

Senior Editor: Nithya Sadanandan

Technical Editor: Maran Fernandes

Copy Editor: Safis Editing

Project Coordinator: Manisha Singh

Proofreader: Safis Editing

Indexer: Tejal Daruwale Soni

Production Designer: Shankar Kalbhor

Business Development Executive: Thilakh Rajavel

Developer Relations Marketing Executive: Deepak Kumar and Rayyan Khan

First published: May 2023

Production reference: 1140423

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham

B3 2PB, UK.

ISBN 978-1-80324-594-2

www.packtpub.com

To my beloved wife, who had to do without me on many evenings, always supported me in the creation, and had my back.

– Peter Krause

Contributors

About the author

Peter Krause looks back on more than 30 years of IT experience, during which he has experienced the entire spectrum from mainframes to client servers to today’s software as a service (SaaS) services. In 2003, he witnessed the birth of Microsoft CRM, the foundation of today’s Power Platform. From that time on, Microsoft technology has shaped his professional life, where he has held roles in nearly every IT project. Peter is a certified trainer and works at Microsoft Corporation as a solution architect, where he helps enterprise customers successfully build their businesses in the cloud.

I would like to thank everyone who supported me with this book, especially my wife, who helped me with many examples with practical experience and patience and gave up a lot for me during the time of writing.

About the reviewers

Klaudia A. Roveri is a principal solution architect in the Fast Track team in the Business Application Group Microsoft. She has worked for Microsoft for 17 years, performing large-scale implementations of CRM and then Dynamics 365 solutions. Klaudia has experience in complex architecture topics, integration, data migration, and implementation of business processes with a special focus on Power Automate with cloud and RPA areas.

Mehmet Kayir is a solution architect who focuses on Microsoft Dynamics 365 Customer Engagement (CE) (sales, customer service, marketing, field service), Power Platform, and Azure Stack. He has industry expertise in banking, insurance, and manufacturing. At Microsoft, he supported enterprise customers from scope definition up to design, implementation, integration, and go-live support. Today he works as a lead solution architect for LEADING Business Solution Kayir GmbH and as a partner to train customers (from scale-ups to industry leaders) and help them get up to speed!

Table of Contents

Preface

1

Getting Started with Power Automate Desktop

What is PAD and what can it do?

Example 1 – automatic response letter processing

Example 2 – integration of a legacy application

What processes should be automated?

How it all started – robotic process automation

Microsoft Power Platform at a glance

UI flows demystified and their role in Power Platform

Connecting PAD to the cloud

Introducing Power Platform environments

Understanding the potential of PAD by looking at an example with MS Office

Summary

Further reading

2

Using Power Automate Desktop and Creating Our First Flow

Understanding the prerequisites for installing PAD

The Windows operating system

Microsoft account

Installing PAD

Creating our first flow

Artifacts of the user interface explained

The Power Automate container window

The designer window

Making use of the recorder

Summary

Further reading

3

Editing and Debugging UI Flows

Details of the designer window/workspace

The parameters dialog

Global menu options

Using breakpoints

Working with subflows

Strategies for effective flow creation

Start simple

Split the whole task

Work on a single item before looping

Deactivate to test steps

Adapt to the available options

Summary

4

Basic Structure Elements and Flow Control

Technical requirements

Using conditionals

Starting with If and Else

Else If action

Special If actions

Conditionals with multiple branches

Handling repetitive tasks with Loop statements

The Loop action

Loop condition

For each

Additional action for flow control

Error handling

On block error

Summary

5

Variables, UI Elements, and Images

Variables and how to use them

Flow variables

Input and output variables

Variable types

The % notation

Identifying and creating UI elements

How to use images with PAD

Summary

Further reading

6

Actions for UI Automation

Why do we need UI actions?

Identify a window

Interact with a window

Extract data from a window

Fill in data in a window

UI actions in action

Microsoft Access database as a source system

Windows executable as the target system

Deconstructing the workflow

Summary

Further reading

7

Automate Your Desktop and Workstation

Technical requirements

Windows and desktop management

Controlling processes and services

Command-line sessions and scripting

Handling files and folders on your desktop

Operating computer peripherals

Workstation

Mouse, keyboard, and clipboard

Creating a PowerPoint system report by using mouse and keyboard actions

Final remark

Summary

Further reading

8

Automating Standard Business Applications

Technical requirements

Automating Microsoft Office

Automating Outlook with actions

Automating Excel actions

Working with SAP

Distributed user management with PAD

The Launch_SAPGUI sub-flow

The “Launch_Excel” and “Launch_Outlook” sub-flows

User data processing

Additional thoughts and automation options

Integrating mainframe scenarios

Browser-based business applications

Notes on this example

Further reading

9

Leveraging Cloud Services and Power Platform

Technical requirements

Power Platform and related services

Machine and Machine Runtime

Accessing a PAD flow from the cloud

Unattended execution (Run mode)

Managing lists, files, and folders with SharePoint

Working with IaaS offerings (Azure/AWS)

AWS actions in use

Working with Azure actions

Summary

Further reading

10

Leveraging Artificial Intelligence

Technical requirements

Introduction to cognitive services and artificial intelligence

An overview of cognitive services

AI in the context of business

Capabilities with optical character recognition

Exploring Microsoft Cognitive Services

AI-based image sorting

Google cognitive

Sentiment analysis in PAD

Working with IBM cognitive

Practical relevance to PAD

More ways to use AI

Summary

Further reading

11

Working with APIs and Services

Technical requirements

The use and automation of local network services

Accessing and managing local AD

Working with databases

Using local exchange and other email services

Working with web protocols and formats

FTP

HTTP

Working with web data formats

Using additional security features

Built-in data handling functionality

Date time actions

Actions for working with text

Interactive flows with Message Boxes

Summary

Further reading

12

PAD Enterprise Best Practices

Chapter prerequisites

Typical requirements in enterprises

Hyperautomation

Development aspects

Installation and deployment

Scalability

Security

Governance and compliance

Microsoft best practices for hyperautomation

Enterprise automation scenarios with PAD

Calling web services within PAD

Providing scalability and reliability with machine groups and queues

Summary

Further reading

Index

Other Books You May Enjoy

Preface

We’re all familiar with the situation, in both our private and professional lives, where we have to perform repetitive and boring IT tasks. Microsoft provides Power Automate Desktop, a free tool that can be used to solve both small and large automation scenarios.

In this book, you’ll learn everything you need to automate repetitive and monotonous processes with Power Automate Desktop to free up more time for more important things. The book provides insights into the history of the program and its current role in the Microsoft Power Platform. It then explains the concept of user interface automation and how locally installed programs or processes as well as a web browser can be implemented with Power Automate Desktop.

As you progress, you’ll learn about the complete feature set of Power Automate Desktop through numerous examples, from basic concepts, such as variables, conditions, and branching, to capabilities with the local desktop, such as file and folder management, to connecting to databases, mainframe computers, and SAP automation.

The final chapters also cover the topic of artificial intelligence and how it can be incorporated into processes, as well as how Power Automate Desktop can be used in large enterprises, where additional topics, such as governance, compliance, scaling, and security, play a role.

Who this book is for

No special IT knowledge is assumed for this book, so an ambitious and process-interested Windows user will be able to find their way around very well, since all the necessary concepts are explained. For the connection of more complex systems, such as SAP, mainframe, or web services, the basic functionality is explained. For their implementation, knowledge in these areas is required.

What this book covers

Chapter 1, Getting Started with Power Automate Desktop, introduces you to the concept of Power Automate Desktop with a first example flow.

Chapter 2, Using Power Automate Desktop and Creating First Flow, covers installing Power Automate Desktop and creating a first flow by using the built-in recorder.

Chapter 3, Editing and Debugging UI Flows, explains the different parts of the application and the fundamental concept of editing and debugging UI flows.

Chapter 4, Basic Structure Elements and Flow Control, introduces using conditionals and loops in UI flows, as well as error handling.

Chapter 5, Variables, UI Elements, and Images, describes what variables are and how they can be used in UI flows, and presents the basic structures for UI automation.

Chapter 6, Actions for UI Automation, continues with the concept introduced in the previous chapter and explains the possibilities of using it to design a process.

Chapter 7, Automate Your Desktop and Workstation, shows how to automate Windows operating systems and services as well as computer peripherals such as the mouse and keyboard.

Chapter 8, Automating Standard Business Applications, represents how Microsoft Office, SAP, and mainframe applications can be automated.

Chapter 9, Leveraging Cloud Services and Power Platform, introduces the concept of Power Automate and desktop flows and how to incorporate IaaS offerings from Microsoft and AWS.

Chapter 10, Leveraging Artificial Intelligence, explains the different capabilities and vendors of AI and how they can be incorporated into UI flows.

Chapter 11, Working with APIs and Services, shows how Power Automate Desktop can also work with different APIs and web services to design an automation process.

Chapter 12, PAD Enterprise Best Practices, explains how Power Automate Desktop can function as part of a larger automation project and what aspects need to be considered.

To get the most out of this book

To work with the content in this book, all that is required is Windows operating system version 10 or 11 and the latest installation of Power Automate Desktop. The installation is described in Chapter 2. It also automates various applications, such as a browser (Edge, Chrome, or Firefox), Microsoft Office, and others that may need to be installed.

Some chapters focus on specific applications to be automated, such as SAP or mainframe applications. For this purpose, development or trial licenses were used, the purchase and installation of which are described in the respective chapters.

If you are using the digital version of this book, we advise you to type the code yourself or access the code from the book’s GitHub repository (a link is available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.

Download the example code files

You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/Democratizing-RPA-with-Power-Automate-Desktop. If there’s an update to the code, it will be updated in the GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots and diagrams used in this book. You can download it here: https://packt.link/nUffQ.

Conventions used

There are a number of text conventions used throughout this book.

Code in text: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “To identify the current file, this gets renamed work-in-progress.docx.”

A block of code is set as follows:

{     'Brand': 'BMW',     'Color': 'blue',     'year of manufacture': '2020',     'type of vehicle': 'SUV' }

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

{     'Brand': 'BMW',     'Color': 'blue',     'year of manufacture': '2020',     'type of vehicle': 'SUV' }

Bold: Indicates a new term, an important word, or words that you see onscreen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “Click on the dropdown for the All available entry and change this to Only the first.”

Tips or important notes

Appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, email us at [email protected] and mention the book title in the subject of your message.

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata and fill in the form.

Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Share Your Thoughts

Once you’ve read Democratizing RPA with Power Automate Desktop, we’d love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.

Your review is important to us and the tech community and will help us make sure we’re delivering excellent quality content.

Download a free PDF copy of this book

Thanks for purchasing this book!

Do you like to read on the go but are unable to carry your print books everywhere?
Is your eBook purchase not compatible with the device of your choice?

Don’t worry, now with every Packt book you get a DRM-free PDF version of that book at no cost.

Read anywhere, any place, on any device. Search, copy, and paste code from your favorite technical books directly into your application.

The perks don’t stop there, you can get exclusive access to discounts, newsletters, and great free content in your inbox daily

Follow these simple steps to get the benefits:

Scan the QR code or visit the link below

https://packt.link/free-ebook/9781803245942

Submit your proof of purchaseThat’s it! We’ll send your free PDF and other benefits to your email directly

1

Getting Started with Power Automate Desktop

Power Automate Desktop (PAD) is based on principle known as robotic process automation (RPA). In this chapter, we will look at the essential concepts of PAD and explore the fundamentals that Microsoft leveraged to create the product. In addition, we will look at how the product fits into the ecosystem of Power Platform and what possibilities exist with it.

In this chapter, we will cover the following topics:

What is PAD and what can it do?How it all started – robotic process automationMicrosoft Power Platform at a glanceUI flows demystified and their role in Power PlatformA first example of the incredible potential of PAD and Power Platform

By the end of this chapter, you will have a thorough understanding of the concept of RPA and how PAD fits into the Microsoft automation strategy. The first example will show you the potential of PAD and provide a taste of what you will learn in this book.

What is PAD and what can it do?

To best understand the functionality of PAD, we will go through a few examples in the following subsections where PAD is ideally used.

Example 1 – automatic response letter processing

Imagine you are part of an organizing team at your child’s school and an event is to be organized at the school.

Someone in the organization team has already created a form letter in which all the parents of the students are contacted and in which the parents should indicate by ticking whether they agree with the participation of their child. All these cover letters now come back as Word documents and contain the student’s names, as well as a ticked box for acceptance or rejection in each case.

You should now generate an Excel list to create an overview of the acceptances and rejections. To do this, you would have to open each Word document and see which student it is and which box was ticked. This whole process is depicted in the following diagram:

Figure 1.1 – How to generate a report out of email attachments

Depending on the number of students and the information that would need to be looked up, this is a tedious and lengthy task. As you can see from the preceding diagram, this process can be quite boring and time-consuming. On top of that, we would also need to repeat this every day until we reach the reporting deadline.

PAD could help in this situation. It is possible to create a flow that checks all emails belonging to a specific topic and saves the Word document into a specific folder. Another flow can examine all files or documents in that folder, extract the relevant information, and transfer it into an Excel spreadsheet. You would need to create this flow once and it would do the rest of the job automatically.

It would even be possible to make use of optical character recognition (OCR) if the letters come back as printed output.

Example 2 – integration of a legacy application

Even today, there are still a high number of legacy applications that were created specifically for certain use cases and can’t be modernized for a variety of reasons. These reasons include a lack of budget, outdated technology, and a lack of resources, competencies, and time.

The employees are virtually forced to work with this application and very often, such applications cannot access the data or processes programmatically via an application programming interface (API) or any other compatible interface.

But what happens when such an application must be integrated into a larger context? For example, there could be a sales platform in which orders and invoices are recorded. However, this data must then also flow into the legacy application to keep the database consistent. Or perhaps, a unique customer number is generated in the legacy application that must be used elsewhere (see Chapter 7 for an example).

In any case, there must be a way to address this legacy application and integrate it into a larger context – and this is where PAD comes in.

With PAD, we can remotely control any desktop application, record a sequence that is always the same, and then run it again. With PAD, we can also execute this flow remotely or from an external event (the job is entered online in a system), read out the calculation or input results, and play them back as values in the workflow.

This means that an application that cannot be called from the outside and can only be operated manually can nevertheless be automated and integrated. It also implies that in system landscapes, where many applications are involved in a process but have no technical connection, PAD can be used to design a coherent flow and exchange data between these applications.

With its almost 400 actions (at the time of writing; the number of available actions is constantly growing), PAD can cover all user scenarios, beginning with web and desktop applications to databases, files, and folders to email and scripting integration. The following diagram illustrates the capabilities of PAD in terms of connections:

Figure 1.2 – PAD capabilities

Apart from remotely controlling locally installed programs, PAD can also connect to numerous external systems and environments, such as cloud environments from Microsoft or AWS, and incorporate artificial intelligence into scripting and web automation. All these connections can be used in a flow of PAD, allowing cross-system processes to be mapped.

What this illustrates is that PAD can cover a wide range of use cases. However, it also doesn’t make sense to use PAD for everything and anything. In the following section, we’ll take a look at what criteria a process should fulfill so that the use of PAD makes sense.

What processes should be automated?

As we saw in the previous sections, PAD is very powerful and can be used in private as well as business contexts. Processes and workflows are all around us and we work with them every day, but which process lends itself to automation?

Creating a flow with PAD also involves a certain amount of work, so it’s worth taking a closer look to see if it’s worth automating a process. Here are some aspects that can be consulted when making a choice:

Do you understand the process well and is it consistent in how it will be executed? If there are too many variations or unpredictable behavior, it will be very difficult, if not impossible, to automate.Is there a sufficient number of repetitions or even a high frequency in which a flow should be executed so that the investment in the work is worthwhile (return on investment – ROI)?Is the process mainly manual and are there many errors that could be eliminated by automation?

There may be also additional aspects that influence a decision to automate processes, but if you take these questions as a starting point, you are on the right track.

How it all started – robotic process automation

The history of RPA started back in the 1990s–2000s. The need for user interface (UI), sometimes also graphical user interface (GUI), software tests became stronger at that time – that is, to be able to automatically click on a software GUI, enter values, and query outputs. For this, the first tools were developed that enabled the first UI and regression tests with the record-and-playback method. Screen scraping technology was also used for this purpose, with which the automation of extracting data from one application was made possible, to use these further in another place. The resulting automatic running process can also be referred to as a bot (the short formof robot).

Somewhat later in 2005, a company called Softomotive was founded that extended the concept of record-and-playback to enable workflows and data between different Windows applications and thus automate processes even across applications. The product was called WinAutomation and was one of the leading providers of RPA software for a long time, along with other manufacturers.

Softomotive was acquired by Microsoft in 2020 and their product WinAutomation was integrated with its functionality in the Power Automate module, which at that time had very limited functionality to automate desktop-based processes. Nevertheless, Power Platform was already very powerful as an overall concept at this point; we will discuss this in Chapter 2.

Microsoft Power Platform at a glance

The actual origins of Power Platform go back very far to the time when there was still talk of Microsoft business solutions. At that time, Microsoft entered the market with a new CRM system, which laid the foundation of today’s Power Platform. This ecosystem consists of several subcomponents that can work very closely together but also separately:

Figure 1.3 – Microsoft Power Platform

These are the components:

Power BI: A tool for visualizing any kind of data in dashboards and reports. Power BI can also capture real-time data from the other components and makes use of the connector capabilities to access data virtually in any data source and combine this with other data to create cross-system dashboards.Power Apps: This allows users to create different types of apps that can be used for specific business processes. There are different types of apps, which, in turn, can be divided into the form factor (phone/tablet) or the way of creation (canvas versus model-driven). Power Apps also leverages the connector concept to use any data source in an app.Power Automate (ancient Microsoft Flow): This is the general term for workflows and business processes that are created within Power Platform. PAD also falls under this category; we will take a closer look at this in the next chapter. But there are also other components here, such as Business Process Flows (BPFs).Power Virtual Agents: This module allows you to create a so-called chatbot. This can then be embedded into a website or other channel and represents an interactive way for the website visitor to contact the company, ask about the status of an order, and more.Power Pages (ancient PowerApps Portal): This module is in preview at the time of writing and comes from the area of portals, which has been around for quite some time. It is a content management system that can be used to create external websites.

The preceding figure also shows three other important building blocks of Power Platform:

Data connectors

With data connectors, it is possible to access and work with all data sources offered through Power Platform. There are already more than 400 available today and more are being added every day. However, if Microsoft or a third-party manufacturer does not offer a connector, it is also possible to create your own connector and use it in the components offered.

AI Builder

AI Builder allows you to include artificial intelligence in your apps or workflows. The offered models cover information extraction and text recognition, as well as translation, but also sentiment recognition or classification of customer feedback according to your criteria. Here, too, it is possible to create your own models of the AI, make them available in the platform, and have them used by the app or workflow creators.

Dataverse

Last but not least, the so-called Dataverse should be mentioned, a very important component of Power Platform. Dataverse is the foundation of Power Platform. All artifacts of the platform are stored and managed here. However, Dataverse is more than just simple data storage. It also contains the security concept, different storage concepts for different requirements, APIs for programmatic access, and much more.

Dynamics 365 workloads store their data models in Dataverse – that is, for a sales module, we find a relational data model with customers and activities, sales opportunities, quotes, and much more. We will see, in an example in Chapter 9, how we can use PAD to enrich these modules and how all these components can interact.

From the beginning, the platform has followed the principle that you don’t need any programming knowledge to create an app, bot, or workflow. Nevertheless, created components can also be extended by code components, from which the term low-code/no-code is derived. Conversely, it does not mean that the platform is not suitable for professional developers. The opposite is true, as Microsoft also invests a lot in supporting professional tools such as application life cycle management (ALM) and thus promotes collaboration in so-called fusion teams – that is, citizen and pro developers.

UI flows demystified and their role in Power Platform

As explained in the previous section, Power Automate is a component of Power Platform. However, Power Automate is in itself also an umbrella term for various types of workflows or simply flows that can be created with it. The following types of flows are distinguished:

Cloud flows: These kinds of flows run in the cloud, meaning they are running on the Microsoft Cloud infrastructure within Power Platform. A cloud flow runs on a specific trigger event – for example, a new contact was created. It could also run instantly, for example by the press of a button in a Power App, or scheduled – for example, every hour. A cloud flow can be designed in the designer in the browser, and it can incorporate any data or systems that are also available online.Business Process flows: Dynamics 365 contains a lot of predefined business processes, such as lead qualification. This describes the path of a prospect to a real customer, as well as the measures and actions required to achieve this. All these actions are recorded in a BPF and help the user determine what needs to be done next to further qualify the prospect. These flows are used exclusively in so-called model-driven apps and are not relevant in the context of this book. For more effective business processes, it is possible to merge cloud flows and BPFs.Desktop flows or UI flows: These kinds of flows run on a local machine or workstation that could also be a virtual machine. PAD is used to create and design these kinds of flows, which can access resources such as locally installed applications or the operating system.

Note

This book focuses on desktop flows and PAD is the tool dedicated to creating these kinds of flows.

PAD contains over 450 so-called actions that can be used to design a flow. These actions and all design capabilities will be explored in the subsequent chapters. In the following subsections, the on-premises data gateway will be explained, as well as the concept of an environment.

Connecting PAD to the cloud

In the previous section, we learned that cloud flows can access data and systems that are online. However, there are scenarios where a cloud flow needs to access a local machine that resides in a home or corporate network (on-premises) – that is, it needs to enable a connection from Microsoft Cloud/Power Platform to a local machine, as we will see in the following example.

In such scenarios, the issue of security takes on a special focus. For example, companies do not want external access to an internal system, or only under very limited and controlled conditions. The concern is justified, because such scenarios typically require firewalls and ports to be adjusted, which potentially allows an attack from the outside.

Without downplaying the issue on the one hand, but not diving too deeply into the topic of security on the other, the concept of the Power Automate machine runtime is presented here. This provides a secure way to allow access from a Microsoft Cloud system to a local computer.

Within the installation and configuration of the machine runtime on your local computer, you would need to connect to Power Platform and specify the corresponding credentials to register the local machine in the environment. After this, different components within Microsoft Cloud could make use of this connection.

Gateways for Desktop flows are deprecated

A commonly used tool for connecting on-premise data sources is the so-called on-premise data gateway. This tool still exists but is no longer supported for connecting desktop flows. Instead, the Power Automate machine runtime is used to invoke local desktop flows from the cloud. For the use of the machine runtime, certain requirements must be met concerning the version and also the licenses. This will be described in more detail in Chapter 9.

Introducing Power Platform environments

Power Platform is the ecosystem in which individual components are created, stored, and executed in environments.

Accordingly, an environment is a container that can wrap around the various components, such as apps and flows, and conversely, each component (app, flow, and so on) always belongs to exactly one environment.

Whether a flow is displayed in the flow list depends on whether the correct environment is selected. We will take this into account in our examples throughout this book.

In this section, we learned that PAD is not only a program for automating local applications, but that it is in a larger context with Microsoft’s Power Platform. PAD can be integrated into larger scenarios and can be used in enterprise environments. The next section shows an initial example of how PAD uses Office programs to map an overarching process.

Understanding the potential of PAD by looking at an example with MS Office

Let’s take another look at the opening example, in which you were asked to help organize a school event as a parent council. This scenario looks like this:

A school event is to take place and the parent council needs to obtain parental consent for the students.Letters have already been sent out to this effect and a Word document has been included. In this document, parents can check off whether or not they consent to their child’s participation. Afterward, the parents should send the Word document back to a specific email address. A document for this example has been defined and looks like this:

Figure 1.4 – Parents Letter document

You now receive a large number of emails, each containing the same document. A summary table with the consents and refusals must be created so that you can do further planning.

This is a good example of a repetitive task that can be nicely automated. The basic procedure is as follows:

Figure 1.5 – Structural view of the flow

The idea here is that you can execute this flow according to your need to collect all responses from parents arriving in the mailbox. Based on this structured flow chart, it is very easy to create a UI flow that does exactly this. Let’s take a look at the main building blocks here and how they have been created in PAD. In the subsequent chapters, we will learn how to create a flow like this in detail:

Launch Outlook and save messages to a specific folder.

The following screenshot shows the first part of the Desktop flow:

Figure 1.6 – PAD Outlook actions

Each box with a symbol represents an action that can be placed on the design canvas via drag and drop. There are over 450 actions available in PAD grouped into different categories such as Outlook, Files, and Folders. The first four actions are Outlook-related and self-explanatory:

Launch Outlook: Starts the Outlook program on the desktop.Retrieve email messages from Outlook: Retrieves messages in a specific folder and also allows you to store attachments in messages to be stored in specific folders.Process email messages in Outlook: This allows you to move messages to some other folder. We will use this to move the messages from the inbox to some subfolder.Close Outlook: Closes the program.Open Excel with the tracking workbook.

The second step is responsible for storing the attached Word documents in a specific folder that is used in the next building block:

Figure 1.7 – PAD Excel and filesystem actions

Let’s look at these actions:

Launch Excel: Opens Excel and also a specific workbook to store the responses.Get Files in a folder: This action checks the local filesystem and creates a list of files in a specific folder. A filter for files can also be applied. In our case, we only want Word documents with the .docx extension.Get Current date and time: Here, the flow determines the current date and time, which we can subsequently include in the corresponding entry in Excel.Handle each document in the attachments folder.

The following block contains the handling for each Word document. The last sentence contains the for each keyword, which is also used in PAD to iterate through a list of items. In the last building block, this list of items/documents has been created by the Get files in folder action and the following block starts with that for each loop, as shown in the following screenshot:

Figure 1.8 – Handling each document in a loop

The actions are as follows:

Rename file(s): Used to rename one or more files. Since we are iterating through the list of Word documents, each iteration contains a different file in the folder. To identify the current file, this gets renamed to work-in-progress.docx.Run application: PAD does not have specific actions for Microsoft Word, but like any other application, this program can also be automated. With this action, we start Microsoft Word on the local machine with a specific document, called work-in-progress.docx, which is the current document.Get selected checkboxes in window: This action can extract true (for checked) or false (for unchecked) from any window of an application. In our example, we extract the information from the checkboxes of the Word document. We need this for the two checkboxes in the document, which is based on a template that was generated and sent in advance.Extract data from window: Similar to a checkbox, this action allows us to extract text data from a window. We use this to extract the name of the child inthe document.Get first free column/row from Excel workbook: The workbook has already been opened in one of the actions. This action helps activate the first empty cell so that we can put content in it.Write to Excel worksheet: This action writes data to the Excel cell specified. We need to perform this action four times to put all the data in.Terminate process: This closes the Word application so that it can be opened with the next document in the next iteration.Housekeeping.

Finally, we need to do some housekeeping, which will be covered by the actions shown in the following screenshot:

Figure 1.9 –Housekeeping PAD actions

In detail, these actions do the following:

Delete file(s): Microsoft Word creates a hidden file when it opens a document that sometimes isn’t deleted and stays in the filesystem. To make sure that we will have valid documents in our folder the next time we run the flow, we just delete the hidden file, if it exists.Save Excel: Saves our entries in the workbook.Close Excel: Closes the program.

This UI flow might look quite extensive because of multiple repetitions to store data in Excel, but it is nevertheless easy to create and very powerful. The time saved is enormous and it increases the more that parents need to be contacted and the more messages that need to be processed. In addition, this process could also be extended to using physical letters as input or responding to email messages.

There are, of course, other examples of Desktop Flows and Power Automate that create connections to some external systems or UI flows that get triggered from some cloud system. We will see examples of this throughout this book.

Summary

In this chapter, we started by providing an overview of PAD and how this product has been integrated by Microsoft into their Power Platform ecosystem. We saw that the product fits perfectly into Microsoft’s strategy and fills the gap in desktop software integration very well.

In our first example, we learned how different Office programs can be integrated to automate a repetitive process. Instead of handling each message and document separately, PAD saved the documents and extracted the relevant information. Thereby, we were able to save a lot of time by automating this process.

In the next chapter, we will create a flow by taking a small and very useful tool to help us: the recorder.

Further reading

To learn more about the topics that were covered in this chapter, take a look at the following resources:

Workflow Automation with Microsoft Power Automate, by Aaron Guilmette (Packt Pub)Microsoft Power Platform Solution Architect’s Handbook, by Hugo Herrera (Packt Pub)Microsoft Power Platform documentation: https://learn.microsoft.com/en-us/power-platform/About the on-premises data gateway: https://learn.microsoft.com/en-us/power-platform/admin/wp-onpremises-gatewayPower Platform environments overview: https://learn.microsoft.com/en-us/power-platform/admin/environments-overview