Schedule Power Automate flow to run only first Tuesday of the month
Posted On January 3, 2021
“I’d like to schedule a flow in Power Automate that will run only once a month on the first Tuesday, is that possible?”
Power Automate offers some options to schedule a flow directly in the ‘Recurrence’ trigger. You can run a flow on a regular basis: daily, weekly, monthly, on specific days…, generally after a fixed time period. But what if you need to run the flow only once a month on a specific day in the week? Not a specific date, e.g. second day of the month, but a specific day, e.g. first Tuesday of the month?
Monthly recurrence allows you to select a date, not a day. Weekly recurrence allows you to select a day within a week, but ignores month. You could schedule recurrence on Tuesday every 4 weeks, but what about months with 5 Tuesdays? How do you tell the flow to run only the first Tuesday in each month?
Start from ‘Week’ frequency
You must split the scheduling into two parts. First, you limit the flow to run only on Tuesday’s, skip all the other days. Second, you further limit it only to the first Tuesday, skipping all the other Tuesdays.
The first part is simple, just switch to the ‘Week’ frequency as when scheduling flow to run only on selected days, and select ‘Tuesday’. This setting will schedule the flow to run on Tuesday every week.
Add trigger condition
The second part is to limit the flow only to the first Tuesday of the month. Being a first Tuesday in a month means that the date must be between 1st and 7th in given month. One week has 7 days, if the date would be higher than 7 it would mean it’s not within the first week. The flow should run only if given Tuesday’s date is less than 7.
You can add a trigger condition into the ‘Recurrence’ trigger to perform this calculation. Since the flow will run only on Tuesday, it’ll check the date only on Tuesday’s and take only the day part from the date into the comparison.
run only if the date part from today's date is less than 8 (= 1 to 7):
utcNow('dd') will take only the day part from today's date
int(...) will convert the day from today's date into an integer
less(...) will compare if the day part from today's date is less than 8
This post was about running a flow only on a first Tuesday in a month, but you can use the same approach for any other day. Using the combination of the trigger settings and trigger condition gives you much more possibilities than the trigger itself. It’s a similar approach as when avoiding multiple approval flow runs: if you can’t achieve the required functionality directly, split it into smaller pieces and combine them.