cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mpankow
Regular Visitor

Stop flow at the weekend

Hey guys, i am handling right now multi level approval flow, i wonder if there is a possibility to for example add some condition at the beggining of the flow to stop counting delays while there is actually weekend in existing flow? 

i found some formulas that might be useful: 

@greaterOrEquals(dayOfWeek(utcNow()), 1)

@lessOrEquals(dayOfWeek(utcNow()), 5)

but unfortunately cant get it to work properly

image.png

Thank you in advantage for help !

1 ACCEPTED SOLUTION

Accepted Solutions

@mpankow 

 

It’s certainly doable. You’ll want to 1st try setting the timeout dynamically with an expression.

So…

if(equals(dayofweek(utcnow()), 5), 84

if(equals(dayofweek(utcnow()), 6), 60,

36))

 

If that doesn’t work, you could try doing a condition action where if the day of week is friday, saturday, or sunday, then go to a Delay until action to delay the approval waiting/timeout until next Monday’s date.

In that case you may need this DateDayOfWeek set-up: 

https://powerusers.microsoft.com/t5/Power-Automate-Cookbook/Date-of-Next-Day-of-Week/td-p/1466540

View solution in original post

8 REPLIES 8
takolota
Super User
Super User

@mpankow 

 

You may be able to use trigger conditions for this if you don’t want the flow to trigger at all with two condition expressions…

 

@not(dayOfWeek(utcNow()), 6))

@not(dayOfWeek(utcNow()), 7))

 

*Also it looks like you were missing an ending parentheses on your previous expressions

@takolota Thank you for your respond, 

 in brief depending on order value it has to be accepted by 1, 2, or 3 diffrent level approvers, I have set approvals timeout for 36 hours for now and i was wondering if when requestor place his item eg. Friday 4PM, is there possibilty to freeze timeouts counting somehow, because right now in such situation after weekend it may reach level 3 approver with lvl 1 and 2 already timed out. 

Is it even doable?

@mpankow 

 

It’s certainly doable. You’ll want to 1st try setting the timeout dynamically with an expression.

So…

if(equals(dayofweek(utcnow()), 5), 84

if(equals(dayofweek(utcnow()), 6), 60,

36))

 

If that doesn’t work, you could try doing a condition action where if the day of week is friday, saturday, or sunday, then go to a Delay until action to delay the approval waiting/timeout until next Monday’s date.

In that case you may need this DateDayOfWeek set-up: 

https://powerusers.microsoft.com/t5/Power-Automate-Cookbook/Date-of-Next-Day-of-Week/td-p/1466540

@takolota ok thank you very much, since timeout in settings won't accept dynamic content, 

mpankow_0-1656064507327.png

i guess i would have to do condition pre approval.  Btw is there possiblility to add condition on top of existing flow(marked as red)? Sorry if question is trivial but im brand new to power automate and tool sometimes feels kinda non intuitive.

mpankow_1-1656066430000.png

 

I’ve done so many flows, I forgot that quirk. You’ll want to add an action below it, then drag that top action below the new action.

 

I’ll add that to a thread on making flow designing easier.

@takolota oh thank you, that works perfectly, so i have last question similar to previous i want to move part of my flow beggining from create approval to if yes action like in picture, or eg. move existing create approval to apply to each control:

mpankow_0-1656067149137.png

Is there also a trick to do that?

 

@mpankow 

 

Just click & drag it in. But make sure to put it above the actions, & drag in the 1st/top-most piece first. If one action depends on another, it won’t let you drag it in until that parent action is already in there.

mpankow
Regular Visitor

@takolota ok, now its all clear to me, thank you very much for your patience and support! Have a nice day!

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (4,855)