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

Posting Approvals to Teams

Microsoft has positioned Teams as the “hub for teamwork” (https://docs.microsoft.com/en-us/microsoftteams/teams-overview, see Teamwork). With that in mind, we’re going to apply the approval flow skills you acquired in Chapter 9, Getting Started with Approvals, and use them to build an approval experience in Microsoft Teams. You’ll be able to use these skills to help streamline the approvals process for members of your organization that are using Teams as a platform.

In this chapter, we’re going to cover the following topics:

  • Configuring prerequisites
  • Configuring an approval flow to use Teams
  • Testing the flow

By the end of this chapter, you’ll be able to integrate a Power Automate approval flow with Microsoft Teams.

Let’s go!

Understanding the flow

Before we configure an approval process, you’ll need to make sure that all of the components that support the process exist. In the example flow, we’re going to configure a Purchase Order approval that begins when a document is posted to a SharePoint site. The approval will show up in Teams. If the purchase requisition is approved, the document will be moved to the Approved folder. If it’s rejected, it will be moved to the Rejected folder. The requester should receive an email at the end telling them the status.

This complex flow is going to use several familiar components, including the following:

  • SharePoint When a file is created in a folder trigger
  • Office 365 Users Get user profile (V2) action
  • Office 365 Users Get manager (V2) action
  • Approvals Create an approval (V2) action
  • Conditions

In this chapter, we’re also introducing the Microsoft Teams connector. With the Microsoft Teams connector...

Configuring prerequisites

This approval flow will require a few components and prerequisites. You’re already familiar with many of them, but we’ll review the exact requirements for this flow. The next two sections will describe the requirements.

A SharePoint site

One of the main outputs of this flow is moving documents between folders on a SharePoint site, based on whether they are approved or rejected. This flow will require a SharePoint site with a document library that contains Submitted, Approved, and Rejected folders, as shown in the following screenshot:

Figure 11.1: Creating folders in the default document library

For this example, we’ll be using a SharePoint site called Purchase Order, but you can use any SharePoint site that you like.

Power Automate app for Teams

The Power Automate app (formerly the Flow bot) for Microsoft Teams enables bidirectional interaction between Teams users and Power Automate. To install the app, you...

Configuring an approval flow to use Teams

As we mentioned in the Understanding the flow section, this flow is going to be initiated by a request or a file being placed on a SharePoint site and result in approval notifications being sent to both the approver and the requester inside Teams. If you want to re-familiarize yourself with some of the concepts related to files, see Chapter 4, Copying Files.

Since this is a longer flow, we’ll complete it in stages:

  • Getting the request’s information
  • Creating the approval
  • Returning the response

Let’s begin!

Getting the requester’s information

In this first section, we’re going to configure the trigger for the flow to detect a new file and obtain information about the file and the requester.

To configure the flow, follow these steps:

  1. Navigate to the Power Automate web portal (https://flow.microsoft.com), select Create, and then select Automated cloud...

Testing the flow

In order to test this flow, you’ll need to meet the following prerequisites:

  • At least two users with Exchange Online and Microsoft Teams enabled
  • Users should have the Power Automate app (formerly called the Flow bot app) enabled
  • One of the users should be configured as a manager of the other users
  • At least two browser sessions, one logged in as approver and one logged in as requester

You can use the Microsoft 365 admin center (https://admin.microsoft.com) to configure a manager relationship. Navigate to Users | Active users, select a user to edit, and click the Edit manager link to configure a manager:

Figure 11.22: Configuring a manager

If you don’t have the capability to set the manager relationship, you will need to edit the flow to use a particular email address of a user to use as the approver instead of the Mail token from the Get manager (V2) action.

The testing process will involve...

Summary

In this chapter, you built on the knowledge that you’ve gained throughout the book to build an approvals integration into Microsoft Teams. You used familiar components, such as the SharePoint file creation trigger and conditions, and expanded into using adaptive cards and the Flow bot for Microsoft Teams. Using this type of design keeps approvers from task-switching or application-switching out of Microsoft Teams to complete approvals, which will help your organization improve productivity.

Finally, you were able to test the flow and see it from the perspective of both the requester and the approver.

In the next chapter, you’ll learn how to start incorporating databases into flows. This will open a lot of opportunities to interact with line-of-business applications and create complex, business-driven automations.

Learn more on Discord

To join the Discord community for this book – where you can share feedback, ask questions to the author...

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