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

Working with Multiple Approvals

In Chapter 9, Getting Started with Approvals, you learned the basic mechanics of an approval flow with a single approver. While that scenario is very common, it doesn’t address all of the likely requirements that you’ll encounter. In many instances, you may need to have multiple individuals approve items, either in sequence or in parallel. This is where multiple approvals fit in.

In this chapter, we’ll discuss some common approval scenarios and then create an example flow using this knowledge:

  • Working with sequential approvals
  • Working with parallel approvals
  • Working with advanced scenarios
  • Creating a basic sequential approval
  • Adding parallel branches

By the end of this chapter, you’ll understand how you can use these techniques independently or together to make more complex approval workflows.

Working with sequential approvals

A sequential approval is an approval scenario requiring various stages of approval before a final approver can accept or reject it. Common scenarios include expense reports or vacation requests where an immediate manager approves an item, which is then routed to a second-level manager.

An example sequential approval sequence is shown in Figure 10.1:

Figure 10.1: Sequential approval

The figure depicts this order of events:

  1. The user adds an item to a SharePoint list.
  2. Power Automate, which is configured to use a new item appearing on the list as a trigger, initiates the approval flow and sends the approval request to the first approver.
  3. The first approver responds to the request (either Approves or Rejects).
  4. The Power Automate flow processes the approval answer. However, unlike a single approval ending the flow, Power Automate instead starts the second stage (or final stage) of the approval.
  5. The second...

Working with parallel approvals

Whereas sequential approvals process as a single thread in a row or stages, parallel approvals happen independently. A vacation request may also take the form of a parallel approval: you may need two individuals to approve time off (such as your immediate manager as well as an HR representative or a direct manager and a project manager), but those individuals might be in different management or reporting structures and their approval processes are independent of each other.

Parallel approval processes allow different branches of approvals to happen independently. Logic at the end of the flow is used to evaluate whether the overall approval is successful.

Working with advanced scenarios

There are some additional configuration options that are available for creating even more complex approval workflows. These options are sometimes used in large organizations where one or more individuals or groups can interact with the approval process. Two such options we’ll briefly look at include mixed approval types and everyone must approve options.

Mixed approval types

For very complex scenarios, an approval may contain multiple levels of sequential approvals, a mix of parallel and sequential approvals, or even a sequential approval inside a parallel approval branch. These types of approvals are known as mixed approvals. When evaluating outcomes and responses, you’ll need to make sure you’re selecting the right dynamic content tokens.

Everyone must approve

When creating an approval workflow, it may be desirable to only send a final response if one of two conditions is met:

  • Everyone included in the...

Creating a basic sequential approval

In this section, we’re going to create a basic sequential approval that involves first- and second-stage approval. These types of approvals are common in scenarios where an individual requests more than a certain number of vacation days or needs to make an expenditure that reaches a certain threshold. For this example, we’ll be creating an approval that evaluates a requested purchase order price. If it’s greater than the $1,000 approval limit of the user’s immediate manager, it will trigger another approval sequence.

Like some other workflows in this book, we’ll use a SharePoint list as the starting point. You can also take input from other methods, such as reading content from a file, a REST API-based webhook from another system, or even requesting user input (which you’ll learn about in Chapter 14, Accepting User Input).

This flow will need a list with a number of different columns and data types...

Adding parallel branches

For approval processes that are either long-running or involve multiple users or interactions, you may want to send periodic email reminders to users. One way to do this is by populating variables at each approval stage and checking whether they’re complete using a parallel approval branch. You’ll do this with five components:

  • The Initialize variable action will be used to configure a variable (such as FirstApprovalDone) that you’ll check throughout the approval. The variable will be initialized to false, and then only set to true once that approver approves the request.

    With some programming languages, you can save the results of an action or command to a variable on the fly. With Power Automate, you must declare variables before you use them.

  • The Do until control will be used to create a loop that periodically checks to see whether the variable (FirstApprovalDone, in the example) has changed...

Summary

In this chapter, you learned how to start creating approval flows that require multiple stages or approvals to be successful. Sequential approvals require a series of approvals to be completed in sequence, while parallel approvals can involve multiple branches of approval actions happening independently.

These types of complex approval request flows are frequently used in medium- and large-sized organizations and reflect real-world scenarios. Becoming familiar with these types of approvals will help you create flows that more accurately meet your organization’s needs in the future.

In addition to multi-stage approvals, you also worked with parallel branches and used delays, loops, and variables to create a framework for sending reminder emails on a regular schedule.

In the next chapter, we’ll look at integrating the approvals process with Microsoft Teams.

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 €14.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