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
takolota
Memorable Member
Memorable Member

@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
Memorable Member
Memorable Member

@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?

takolota
Memorable Member
Memorable Member

@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

 

takolota
Memorable Member
Memorable Member

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?

 

takolota
Memorable Member
Memorable Member

@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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

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

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (3,902)