“Can I apply the ‘first working day’ solution also to another specific day, e.g. trigger Power Automate flow on the 4th working day?”
The previous post described how to trigger a Power Automate flow on the first working day in a month, but what if you want a different day? If it shouldn’t be the first day as it’s often busy but a later day, e.g. the 4th day in a month? Can the solution be adjusted? How?
Note: this solution won’t skip holidays as I’m not aware of any way to check holidays before triggering a flow. It’ll also work only up to the 5th working day including max. 1 weekend.
The idea stays the same
The logic behind the trigger condition stays the same – if the day is in a weekday, trigger the flow. If it’s Saturday or Sunday, wait until the next Monday.
Change the number for date
The only difference from the original article is in the numbers that identify the date.
and(equals(int(utcNow('dd')),<whichDay>),not(equals(dayOfWeek(utcNow()),6)),not(equals(dayOfWeek(utcNow()),0)))
To send it on the 4th day:
and(equals(int(utcNow('dd')),4),not(equals(dayOfWeek(utcNow()),6)),not(equals(dayOfWeek(utcNow()),0)))
Change it also for Sundays…
The same applies also to the conditions when the date was Saturday or Sunday – you must increment the date. If the day ends up being a Sunday, you want to send it on the following Monday, the planned date + 1 day.
and(equals(int(utcNow('dd')),<whichDay+1>),equals(dayOfWeek(utcNow(),1)))
For the 4th day it’ll be 5, e.g.
and(equals(int(utcNow('dd')),5),equals(dayOfWeek(utcNow(),1)))
… and for Saturdays
If it takes 1 extra day for Sundays, for Saturdays it takes 2. Take again the day number, and this time increment it by 2.
and(equals(int(utcNow('dd')),<whichDay+2>),equals(dayOfWeek(utcNow(),1)))
To follow with the 4th day example, the number will be 6 this time.
and(equals(int(utcNow('dd')),6),equals(dayOfWeek(utcNow(),1)))
Put it all together
All that’s left is to put all the conditions together in a single trigger condition.
@or(
and(equals(int(utcNow('dd')),<whichDay>),not(equals(dayOfWeek(utcNow()),6)),not(equals(dayOfWeek(utcNow()),0))),
and(equals(int(utcNow('dd')),<whichDay+1>),equals(dayOfWeek(utcNow(),1))),
and(equals(int(utcNow('dd')),<whichDay+2>),equals(dayOfWeek(utcNow(),1)))
)
Summary
If you want to trigger Power Automate on a specific working day, you have to use the various dates involved. The first one is the actual day, what’s the default scenario if it’s during the workweek. The second one is the date+1 for situations when the original date ends up being Sunday. And the last one is the date+2 to cover for Saturdays. Once you add these 3 numbers in the trigger condition you should be able to trigger the flow on any specific day working day in a month.
But don’t forget that this solution will work only for the 1st 5 working in a month as it includes only 1 weekend! A generic solution would look similar to this post, which I might cover in the future.
great article thank you very much
How should the expression be if I want to trigger the flow every day starting from the 4th working day?
Hello V.K.,
no idea, I never had to deal with such request.
Hello, although this is very helpful, there is an issue with this formula, if the first day of the month is saturday or sunday, the trigger will activate on the first or second working day of the month respectively, I don’t know if there is a workaround for this. Thanks.
This is if you are looking to activate on the 3rd working day i am sorry, and I think this would solve it for the 3rd working day, you would have to add wednesday and thursday for the 4th and 5th day.
@or(
and(equals(int(utcNow(‘dd’)),3),or(not(equals(dayOfWeek(utcNow()),1)),not(equals(dayOfWeek(utcNow()),1))),
and(equals(int(utcNow(‘dd’)),3), equals(dayOfWeek(utcNow()),5)),
and(equals(int(utcNow(‘dd’)),3),not(equals(dayOfWeek(utcNow()),6)),not(equals(dayOfWeek(utcNow()),0))),
and(equals(int(utcNow(‘dd’)),4),equals(dayOfWeek(utcNow(),1))),
and(equals(int(utcNow(‘dd’)),5),equals(dayOfWeek(utcNow(),1)))
)
just realized is also wrong…
Hello and thank you for your great site and articles. Is there a way to use this to make a flow trigger specifically on the 20th day of every month?
Hello Matthew,
if you mean the 20th day of a month, no matter what day of the week it is, you can use a daily trigger with a trigger condition @and(equals(int(utcNow(‘dd’)),20). Or with a monthly trigger with the start time of the 20th of the current month.