Skip to content

Latest commit

 

History

History
187 lines (116 loc) · 7.8 KB

modern-approvals.md

File metadata and controls

187 lines (116 loc) · 7.8 KB
title description services suite documentationcenter author contributors ms.author ms.reviewer editor tags ms.subservice ms.topic ms.tgt_pltfrm ms.workload ms.date search.audienceType
Create and test an approval workflow with Power Automate
Learn how to automate approval workflows that integrate with SharePoint, Dynamics CRM, Salesforce, OneDrive for Business, Zendesk, or WordPress.
flow
na
natalie-pienkowska
natalie-pienkowska
kartikraop
v-aangie
kisubedi
angieandrews
cloud-flow
conceptual
na
na
01/12/2023
flowmaker
enduser

Create and test an approval workflow with Power Automate

With Power Automate, you can manage the approval of documents or processes across several services, including SharePoint, Dynamics 365, Salesforce, OneDrive for Business, Zendesk, or WordPress.

To create an approval workflow, add the Approvals - Start and wait for an approval action to any flow. After you add this action, your flow can manage the approval of documents or processes. For example, you can create document approval flows that approve invoices, work orders, or sales quotations. You can also create process approval flows that approve vacation requests, overtime work, or travel plans.

Approvers can respond to requests from their email inbox, the approvals center in Power Automate, or the Power Automate app.

Create an approval flow

Here's an overview of the flow we'll create and test:

Approval flow.

The flow performs the following steps:

  1. Starts when someone creates a vacation request in a SharePoint Online list.

  2. Adds the vacation request to the approval center, and then emails it to the approver.

  3. Sends an email with the approver's decision to the person who requested vacation.

  4. Updates the SharePoint Online list with the approver's decision comments.

[!INCLUDE sharepoint-detailed-docs]

Important

Always follow the best practices for SharePoint security and your organization's best practices to ensure your environment is secure. Security is outside the scope of this article.

Prerequisites

To complete this tutorial, you must have access to:

[!INCLUDE prerequisites-for-modern-approvals]

Create these columns in your SharePoint Online list:

Column Type
Title Single line of text
Start Date Date and Time
End Date Date and Time
Comments Single line of text
Approved Yes/No
Manager Comments Single line of text

Make note of the name and URL of the SharePoint Online list. You'll need these items later when you configure the SharePoint - When an item is created trigger.

Create an automated cloud flow

[!INCLUDE sign-in-and-create-flow-from-blank-template]

Add a trigger

[!INCLUDE add-trigger-when-sharepoint-item-created]

The Site Address and the List Name are the items you noted earlier in this walkthrough.

SharePoint info.

Add a profile action

  1. Select New step, and then type profile into the Choose an action search box.

  2. Select Office 365 Users.

  3. Find, and then select the Get my profile (V2) action.

    search for profile.

  4. Select the fields from your profile that you want to include in your flow, and then select Create to save the work you've done so far.

Add an approval action

[!INCLUDE add-an-approval-action]

Note

This action sends the approval request to the email address in the Assigned To box.

If your scenario requires it, you can attach files to your approval requests that use Microsoft Dataverse.

Add an email action for approvals

Follow these steps to send an email if the vacation request is approved.

[!INCLUDE add-action-to-send-email-when-vacation-approved]

configure approved email template.

Add an update action for approved requests

[!INCLUDE add-action-to-update-sharepoint-with-approval]

Note

Site Address, List Name, Id, and Title are required.

update item configuration.

Add an email action for rejections

[!INCLUDE add-action-to-send-email-when-vacation-rejected]

configuration for rejected requests.

Add update action for rejected requests

[!INCLUDE add-action-to-update-sharepoint-with-rejection]

Note

Site Address, List Name, Id, and Title are required.

update item card.

  1. Select Save to save the work we've done.

If you've followed along, your flow should resemble this screenshot:

Completed flow.

Now that we've created the flow, it's time to test it!

Request an approval to test your flow

[!INCLUDE request-vacation-approval]

Create long-running approvals

If it's likely that your flow will run for more than 30 days, consider storing your approvals in Microsoft Dataverse. This makes it possible for you to create flows that act on responses to approval requests, even after the original flow run times out.

To do this, use two flows, one to send an approval request, and the other to run business logic on the responses to the approval request, based on the Create an approval (v2) action. Learn more about long running approvals.

Tip

If you use modern email clients, you don't have to wonder if a request is still required because Power Automate automatically updates the email to indicate that the approval request is completed.

Cancel an approval request

Sometimes you might want to cancel an approval request that you've sent. Possibly you made a mistake in the request, or it’s no longer relevant. In either case, the person who sent the request can cancel it by following these steps:

  1. Select the approval
  2. Select Cancel approval in the side pane.

Tip

You can always select the History tab to view the approval requests that you've canceled.

Note

The cancel feature is supported on the Create an approval (v2) action.

Request approvals from guest users

You can send approvals requests to persons outside your organization. To do this, use Microsoft Entra guest users by inviting users from other tenants as guests.

When you assign a role to a guest, this gives the guest the permission required to participate in the approval process.

Now that you've created and tested your flow, be sure to let others know how to use it.

Related information

[!INCLUDEfooter-include]