cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Hobo
Frequent Visitor

Remind and Escalate Approvals based on Business Days/Working Hours

Hi all, 

 

I'm very new to Power automate but have succesfully managed to set up a workflow with multiple approvals etc. and am quite happy with how it's working. All the approval steps etc. are logged into a Sharepoint list for records. 

 

My issue is that I want my reminder (set up by a parallel "do until" flow that checks a variable of approval complete) combined with a delay. How can I set this delay/reminder up to be based on working hours

 

Second question is the Timeing out of approvals in order to be an escalation based on time out and the following approval to run only if the first one times out. How can that timeout be set to business hours? 

 

Thanks all for your help - I have googled a lot but all the solutions seem quite complex - I imagine there must be an easy solution given that this must be something that most people would require? 

1 ACCEPTED SOLUTION

Accepted Solutions
manuelstgomes
Super User
Super User

Hi @Hobo 

 

The first question regarding working hours. A simple function will tell you the current hour:

int(formatDateTime(utcNow(),'hh'))

 

Then you can compare it with the working time. Here's an example Power Automate:

Screenshot_2020-07-27_at_10_02_19.jpg

 

The second question is a little bit more tricky. The short answer is that you can't. The timeout occurs 28 days after the approval is triggered. You can configure the "Run after" to catch that timeout and take the appropriate measures. Here you can do the same and validate if it's working hours, but you can't control when the timeout occurs.

Screenshot 2020-07-27 at 10.05.18.png

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

 

 

View solution in original post

3 REPLIES 3
manuelstgomes
Super User
Super User

Hi @Hobo 

 

The first question regarding working hours. A simple function will tell you the current hour:

int(formatDateTime(utcNow(),'hh'))

 

Then you can compare it with the working time. Here's an example Power Automate:

Screenshot_2020-07-27_at_10_02_19.jpg

 

The second question is a little bit more tricky. The short answer is that you can't. The timeout occurs 28 days after the approval is triggered. You can configure the "Run after" to catch that timeout and take the appropriate measures. Here you can do the same and validate if it's working hours, but you can't control when the timeout occurs.

Screenshot 2020-07-27 at 10.05.18.png

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

 

 

View solution in original post

Thanks very much - the first part is 100% answered 🙂

 

With regards to the second part, I have found a convoluted way to set the approval timeout based on the day of the week it is initiated and a switch case that calculates the timeout (i manually calculated and entered the value for each day)

 

Not the most elegant solution - and very surprised that there isn't an option built in!

 

 

Hobo
Frequent Visitor

for anyone else that finds this thread - a bit more feedback. 

 

I initialized an integer variable with a value of say 5. This means 5 hours in my example. 

 

I also have a boolean variable that is initialized as false, and gets set to true once the approval is actioned. This will allow me to check if the approval is complete whilst in the middle of a do until loop with delays. 

 

I then converted UTC time to my local time, and then utilised the int() formula provided above. The only change is to remember to use capital H in the 'HH', so that it returns in 24h format. 

 

I then also added two 'dayofweek' not equal to 0 and not equal to 6 (using the converted times) as an additional two conditions to avoid Saturday and Sunday. 

 

Hobo_0-1596608751533.png

 

Finally, I added a 1 hour delay if the above criteria matched, and then decrement the variable by 1. This means it will count down my timer ever 1 hour during business hours. The not matching criteria for this one is just a 30 minute delay, and then return to the start of the loop. This is to avoid going over the "do until" cycle limits. 

 

Hobo_1-1596608773090.png

 

Finally, I added a condition for timer variable = 0, and that then triggered my reminder email, as well as re-setting the timer. This then allows me to have further reminder emails to occur in a shorter or longer timeframe as required.

I also added a final check to see the approval had been actioned during that 1 hour delay period. 

 

Hobo_2-1596608796361.png

 

 

 

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,879)