Reader small image

You're reading from  Microsoft 365 Fundamentals Guide

Product typeBook
Published inMay 2022
PublisherPackt
ISBN-139781801070195
Edition1st Edition
Right arrow
Authors (2):
Gustavo Moraes
Gustavo Moraes
author image
Gustavo Moraes

Gustavo Moraes is the CEO of Trentim, a company focused on providing management methodologies and tools mainly in the Microsoft ecosystem, with a large client base in Brazil and abroad. He is an MCT (Microsoft Certified Trainer). He has been working with Microsoft technologies for over 12 years with extensive expertise in process automation, and project and task management. He is one of the leading names in the field of automation on Microsoft and Low Code platforms in Brazil. He has led many events and communities in addition to being a prominent user in the Microsoft community. Christian, married to Aline for 8 years and father of Alexia and Natasha.
Read more about Gustavo Moraes

Douglas Romao
Douglas Romao
author image
Douglas Romao

Douglas Romão has been a Microsoft Most Valuable Professional in Office Apps & Services and Business Applications since 2017. He is a Microsoft Certified Trainer and has been working with Microsoft technologies for over 15 years, focusing mainly on developing productivity and collaborative solutions. Currently, work as a Senior Solution Architect & Business Consultant within the Power Platform and Project & Portfolio Management field, leading technical communities and sharing knowledge through conferences, his YouTube channel/blog, and a podcast. Christian, father of Vicente (a 7-month-old baby boy by the time this book has been released) and married to Mariana.
Read more about Douglas Romao

View More author details
Right arrow

Chapter 11: Doing More with Microsoft Power Automate

Nowadays, all companies, from small to multinational, use various software. It is increasingly rare to find a company that does not use software. We have a service, an app, or even a website for everything, from image generation to complex payment systems; we have software and more software. At the beginning of 2021, I read an article that showed 25 social networks that you had to know for 2021… I cannot keep even 2 of my social networks up to date!

For some time, the demand for IT people has been growing exponentially. However, if it was scarce years ago, today, it has become increasingly difficult to meet organizations' needs for more and more apps. As a result, about 37% of company processes are still based on paper! Important documents are still being written in pen and on clipboards, being subject to errors and with little chance of generating insights and taking timely action.

To solve a large part of this...

Creating a flow

Power Automate, because of its connectors, can automate processes involving any tool that allows integration. To start using it, you only need to know some basic concepts and the process that you want to automate.

There are two ways to start your flows. The simplest is through templates. On the home page, you can find a variety of flows made by Microsoft and the entire community for a certain type of business, or even for a certain tool. To start using a template, just choose one and customize it if necessary to suit your process (see Figure 11.1).

Figure 11.1 – Power Automate home page

Another way to start your flow is from the sketch, choosing from the type of flow to each action of it. To do that, go to the Create tab from the left menu, as shown in the preceding screenshot.

Before creating your first flow, you need to know about three main Power Automate structures that are used in all flows: connectors, triggers, and actions...

Using the correct place for your flows

Getting started with Power Automate is simple as it is free if you already have a 365 license, it has an interface prepared for citizen developers, it has countless flow templates, and it has infinite creative possibilities. It has become more and more present in companies, and as we have seen, it is still growing. The first tip I want to give you is not related to "life hacks" or even connector configurations, but if you have the following knowledge in your mind, you will know exactly where to create your flows and how to educate people around you about it.

It may seem simple, but if, even in our daily lives, we unintentionally keep things in the wrong places, it becomes very chaotic. This can happen to our flows and cause big problems for you and your organization as automation increases.

Important Note

Unfortunately, we cannot yet tag or group flows within folders. If you are a participant in the Power Automate community...

The joker action

When we are developing a flow, we need to think in steps. This mentality is very important if you want to be successful with your automation. Power Automate allows you to restart flows, making it easy for you to test, and after you change flows, you can test them again. When you open a flow, you can see the status of each action and its input and output.

Figure 11.6 – Input and output of an action

As a tool that integrates numerous systems, Power Automate has more than 400 connectors, adding more than 1,000 actions that can be done in the flows, from actions such as sending an email or posting a tweet, to complex actions such as generating a document and making screen simulations.

Within these actions, we have an action called the compose action. I prefer to call it the joker action, given that it can be adapted and used in any flow and in different ways. This action can be used to save yourself from having to enter the same data...

Using variables to store and change data

Reusing stored information is one of the best development practices and this applies to flows in Power Automate as well. This is the concept of variables in programming. The computer allocates some memory space to a certain value with a particular name, which will return the stored value whenever the name is used. When, in the previous section, we talked about the compose action, I mentioned the programming concept of the constant variable, that is, the value is stored in that name, but it cannot be changed.

When we need to separate a space to store a value and the compose action does not work, we use the set of actions from the Variable group. You can see some of the Actions in the following screenshot:

Figure 11.8 – Variable actions in Power Automate

When initializing a variable, you must define a unique name and type, and if you already have an initial value, you can define it. If the value you want is obtained...

Segregating your flow paths and bypassing actions

Some flows are simple, and we manage to make them sequential without conditional actions or parallel steps, and the simplicity of Power Automate allows this to be quick and effective. However, in certain situations, we need to make complex flows, and Power Automate makes that possible too!

By default, actions are sequential, and the next action will only start when the previous one is finalized. This can be a problem when actions depend on some approval or even when we want better performance in a flow. For such cases, we will create parallel actions, and in order to create them, just click on the new action button and choose Add a parallel branch (Figure 11.10).

Figure 11.10 – Adding a parallel branch to segregate paths

When creating this type of action, a single sequential path gets divided into two or more paths occurring simultaneously. Even if a path stops because of an error in an action or gets...

Using actions to organize your flows

The organization of your flows may never be definitive and sufficient, especially because in most cases, our flows are growing and doing more and more things for us. This is the essence of automation, and the motto of Power Automate is "Take care of what's important. Automate the rest".

So, organizing will always be necessary. In the next few paragraphs, we will see various tools that we can use in our organization. Let's get started:

  • Action name

In our examples, we saw that the names were all with the name of the action that comes by default, such as "Compose." If we keep the original name, we will not be able to understand the action's purpose or importance.

Inside Power Automate, we can give our actions any name without disturbing or hindering the flow. We must give short names to our actions that make sense, for example, Store item ID and Convert Item price to USD.

  • Action comments...

Copying and sending actions to others

In our daily lives, we use several different tools. If you work with Office 365, you use Outlook for email and if you work with Google Workspace, you use Gmail. Power Automate is connected to almost 400 different systems, not to mention the actions that can be done through Application Programming Interfaces (APIs) or Robotic Process Automation (RPA).

There will probably be a Power Platform connector to the tools you use, and you will be able to create flows that suit your process. Once this is done, you will have several flows in your process actions that can be reused in other flows of yours, or in your area, or even in the organization. When asking for help in the community, many will help by posting step-by-step screenshots or videos of how you can redo the same actions in your environment.

Recording videos, making step-by-step images, or even exporting the stream and uploading it are effective ways to solve problems. However, there is...

Viewing all your execution logs and organizing them

You have probably used logs already, and we have also talked in this chapter about the history of executions so you can see the steps your flow went through and what happened within each action. The general flow details screen demonstrates a short history of the executions of the flow (Figure 11.17). However, we can go further and really understand how Power Automate works.

Figure 11.17 – The main screen of a flow

With all the connectors automated, Power Automate undertakes constant checks to establish whether there is something new. For example, in the When a new email arrives connector, Power Automate constantly goes to Outlook and checks whether there are any new emails so it can start the flow. This is an execution, but it does not appear in the initial history screen!

This execution is done every 3 minutes or less (depending on your license), and it is through that execution that the flow is...

The secret of trigger conditions

As we saw in the previous section, our flow always checks whether it needs to be executed, and when there is new data, it is executed. We learned how we can use the Terminate action in our favor to organize the records. Often, this action is essential, but sometimes, instead of using this action in our flow, we could simply use trigger conditions. When we use trigger conditions, the flow not only checks whether new data is added but also checks whether this new data meets the condition applied.

The logic involved in this is quite simple, but the execution is a little more complex because we need to properly understand the functions of Power Automate. I will demonstrate how to easily make use of trigger conditions, and as you become better acquainted with Power Automate, you will be able to use these conditions without this trick.

Important Note

You can see all the details about the various functions at https://docs.microsoft.com/en-us/azure...

Summary

In this chapter, we saw that Power Automate can do a lot for us in our day-to-day repetitive work, giving us time to do more important things and improve our service, our area, and our company. As it is a simple tool, everyone can start using it to solve their problems, but using it incorrectly can greatly damage the organization in the medium and long term. In this chapter, we learned where we should store our flows, how to validate and walk step by step, how to make our flow clear and organized, and how to prevent automation from becoming gremlins beyond our control!

And, of course, we learned how we can share all our work and best practices with other people so that their life is automated, just like ours!

In the next chapter, we will continue our saga within the Power Platform, learning how to do business apps with Power Apps.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Microsoft 365 Fundamentals Guide
Published in: May 2022Publisher: PacktISBN-13: 9781801070195
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

Authors (2)

author image
Gustavo Moraes

Gustavo Moraes is the CEO of Trentim, a company focused on providing management methodologies and tools mainly in the Microsoft ecosystem, with a large client base in Brazil and abroad. He is an MCT (Microsoft Certified Trainer). He has been working with Microsoft technologies for over 12 years with extensive expertise in process automation, and project and task management. He is one of the leading names in the field of automation on Microsoft and Low Code platforms in Brazil. He has led many events and communities in addition to being a prominent user in the Microsoft community. Christian, married to Aline for 8 years and father of Alexia and Natasha.
Read more about Gustavo Moraes

author image
Douglas Romao

Douglas Romão has been a Microsoft Most Valuable Professional in Office Apps & Services and Business Applications since 2017. He is a Microsoft Certified Trainer and has been working with Microsoft technologies for over 15 years, focusing mainly on developing productivity and collaborative solutions. Currently, work as a Senior Solution Architect & Business Consultant within the Power Platform and Project & Portfolio Management field, leading technical communities and sharing knowledge through conferences, his YouTube channel/blog, and a podcast. Christian, father of Vicente (a 7-month-old baby boy by the time this book has been released) and married to Mariana.
Read more about Douglas Romao