Contents

Skip approver if also the creator of the request with Power Automate

 

Wouldn’t it be nice and kinda logical that, when someone creates a request via an app (i.e.: expenses, training), if the creator is also the first approver, we skip this particular approver? After all, if I create a request it’s because I “want” something? So I’m pretty sure I’ll approve it 😏

In this blog post, that’s why we’re going to do using SharePoint as a backend for the requests, and Power Automate for automating the approval process.

App & columns used for creating the requests
In a real world scenario, you’ll likely be using a PowerApps App to create the requests, and send the data back to SharePoint/Dataverse. But the focus of this post is the automation process, therefore we’ll keep it simple.

 

Setting up the scene

This is what we could have in SharePoint for a real :

  • Lists:

    • Training Requests –> This will store all the requests

 

  • Columns (Training Requests list):

    • Products –> SharePoint, PowerApps, Azure AD, PowerShell, whatever else you’d like, etc… (Choice type)
    • Approver1 –> The name of the first approver (Person/Group type)
    • Approver1 Approval Status –> Pending, Approved, Rejected (Single line of Text type - and that’s for simplicity in conjunction with the PowerApps. Can also be a Choice if you’d prefer)
    • Approver2 –> The name of the second approver (Person/Group type)
    • Approver2 Approval Status –> Pending, Approved, Rejected (Single line of text - That’s for simplicity in conjunction with the PowerApps app. Can also be a Choice if you’d prefer)

 

The Flow

Create an Automated Flow with the When an item is created trigger.
Then, we’ll have our condition to check if the CreatedBy (a.k.a the author) is equal or not to the Approver1 person.

/images/powerplatform-screenshots/skip-approver-if-equals-to-createdBy-img1.png
 

Condition operator
In this case, I’ve chosen the operator is not equal to, but you can choose is equal to. Simply reverse the actions performed by the condition.

Then, we may want to use the Start & Wait for an approval action, or we could just use the “Send Email” action with Deep Linking, and redirect the approver(s) into the App directly. Choice is yours! 😉 We’ll keep it simple with a Start & Wait for an approval action.

So, if Yes (meaning the CreatedBy Email is NOT equal to the Approver1 Email), then request approval from “Approver1”. A bit of formating, a salt of configuration, and poof! The process is started.

/images/powerplatform-screenshots/skip-approver-if-equals-to-createdBy-img2.png
 

if No (meaning the CreatedBy Email IS equal to the Approver1 Email), first update the item to mark Approver1 Approval Status to “Approved” & Approver2 to “Pending”, then request approval from “Approver2” directly.

/images/powerplatform-screenshots/skip-approver-if-equals-to-createdBy-img3.png
 

Creating a request to test the Flow

Creating a request as myself, the flow should route to the No part of the condition, and update the item first, then send for approval to Approver2. and it does! 🥳

/images/powerplatform-screenshots/skip-approver-if-equals-to-createdBy-img6.png
 

/images/powerplatform-screenshots/skip-approver-if-equals-to-createdBy-img5.png
 

Thanks for reading! 🙂