Skip to content

Power Automate

Extend A Power Automate Approval Over The 30 Day Limit

Extend A Power Automate Approval Over The 30 Day Limit Posted by - Matthew Devaney on - May 26, 2024 28 Comments Power Automate approval flows can go beyond ...

Matthew Devaney
Published
Reading time
5 min read

Before you start

Is this guide for you?

Best entry point
Power Automate
Time investment
5 min read

Imported reference from Matthew Devaney's blog for learning purposes. Original: https://www.matthewdevaney.com/extend-a-power-automate-approval-over-the-30-day-limit/. Author: Matthew Devaney.

Extend A Power Automate Approval Over The 30 Day Limit Posted by - Matthew Devaney on - May 26, 2024 28 Comments

Power Automate approval flows can go beyond the 30 day limit if they are designed properly. A flow that waits an approval for over 30 days will timeout due to a limitation of the service. However, we can create an approvals process with an infinite duration by creating two separate flows. The 1st flow will create the Approval and then end. Then the 2nd flow will wait for the approval to become completed , determine the outcome, and then run any subsequent action. Table of Contents

Introduction: The Budget Request Approval Flow Setup The SharePoint List

Build A Power Automate Flow To Create Approvals

Create A Power Automate Flow To Collect Approval Results

Run The Create An Approval Flow In Power Automate

Test The Automated Flow To Get The Approvals Response

Introduction: The Budget Request Approval Flow

Managers at a manufacturing company use the budget request approval flow to ask for funding. This funding is used to purchase or upgrade equipment. An approval can take longer than 30 days so it is important that approval flow does not timeout. Setup The SharePoint List

Create a new SharePoint list named Budget Requests with the following columns: Title Amount (number) Requested By (person)

Request Status (choices: Submitted, Approved, Rejected) Approval ID (text)

The SharePoint list does not require any data to be populated initially. Over time as budget requests are added the list will begin to look like this.

Build A Power Automate Flow To Create Approvals

A long running approvals process with no 30 day time limit will require two flows. The 1st flow will create the new approval and the 2nd flow will wait for the approval to be completed and take any subsequent actions.

Open Power Automate and start an automated flow when a new item is created in the Budget Requests SharePoint list. Then create a new approval using inputs from the Budget Request item. Once the approval is sent update the budget request status to submitted and write the Approval ID to the SharePoint list. This will allow us to track which Power Automate approval is related to which Budget Request.

The final flow action updates the approval record in Dataverse to add a source named “Budget Requests.” We will use the source column to track the origin of the approval flow. And to ensure our 2nd flow only triggers on approvals requested from within the 1st flow.

Create A Power Automate Flow To Collect Approval Results

When an approval is completed the 2nd flow collects the result and takes any subsequent actions. Create a 2nd automated flow and use a Dataverse trigger to start it when a row is modified in the Approvals table. Only trigger the flow when the statuscode column is updated and check to see if the approvals source is “Budget Request” and the statuscode equals Completed (option set value: 192350004).

Then use the SharePoint – Get Items action to find the Budget Request with the matching Approval ID. If the approval result is “Approve” then update the Budget Request status to Approved. Or if the approval results it “Reject” then change the Budget Request status to Rejected. Flow Expressions:

Dataverse When A Row Is Added Modified or Deleted – Select Columns statuscode

Dataverse When A Row Is Added Modified or Deleted – Filter Rows

msdyn_flow_approval_source eq 'Budget Request' and statuscode eq 192350004 Code language: JavaScript ( javascript ) SharePoint Get Items – Filter

triggerOutputs ()? [ 'body/msdyn_flow_approvalid' ] Code language: CSS ( css )

SharePoint Update Item Approved – Request Status

first(outputs( 'Get_items:_Budget_Request' )?[ 'body/value' ])?[ 'ID' ] Code language: JavaScript ( javascript )

SharePoint Update Item Rejected- Request Status

first(outputs( 'Get_items:_Budget_Request' )?[ 'body/value' ])?[ 'ID' ] Code language: JavaScript ( javascript )

Run The Create An Approval Flow In Power Automate

Our long running approval process is ready to test. Save both of the flows we have created and turn them on.

Go ahead and create a new item in the Budget Requests SharePoint list with the following values: Title – Paint Booth Upgrades Amount – 200,000

Requested By – Mary Baker (or someone in your organization)

The approval will appear in the recipient’s Approvals Center.

In the background the Power Automate flow does not await a response to the approval and continues to run. It updates the SharePoint list item with a status of Submitted and the Approval ID.

And it also updates the Approvals table record with the source Budget Request .

Test The Automated Flow To Get The Approvals Response

Trigger the second Power Automate flow by asking the approval recipient to choose Accept.

The approval now appears with a status of approved in Approvals Center.

When the approval is Accepted the status reason changes to Completed. The flow trigger conditions are now met so the flow begins to run

The SharePoint list item with the matching Approval ID is updated with the request status of Approved. If the response were Reject instead, the list item would show the status Rejected. Did You Enjoy This Article? 😺

Subscribe to get new Copilot Studio articles sent to your inbox each week for FREE Enter your email address Sign Me Up Questions?

If you have any questions or feedback about Extend A Power Automate Approval Over The 30 Day Limit please leave a message in the comments section below. You can post using your email address and are not required to create an account to join the discussion. Matthew Devaney Power Automate

Save Docusign Document To SharePoint With Power Automate

Share this

Tagged

Approvals · Power Automate

Have a Microsoft 365 topic idea?

Share article suggestions, community session ideas, corrections, or real-world scenarios for future nextM365 learning notes.

Suggest a topic

Keep learning Microsoft 365

Explore more practical guides for SharePoint, Power Platform, Copilot Studio, migration, automation, governance, and security.

Continue learning

Next action

What to do next

Browse all tutorials →