cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Run Flow on the last Sunday each month

Hi, I have a flow which I want to schedule to run on the last Sunday of each month. What is the best method to use to achieve this?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Impactful Individual
Impactful Individual

Re: Run Flow on the last Sunday each month

@Anonymous Hi,

 

The only thing I can think of is to run the flow each week on Sunday and then use a number of conditions to check if it is the last Sunday of that month. Then put any actions you wish to perfom under this condition.

 

For example you could do the following

2019-04-15_0927.png

 

Formula for 'Current Day of Month' 

int(dayOfMonth(utcNow()))

Formula for ' Current Month'

int(substring(utcNow(),5,2))

Then use a condition to see if the current month has 30 days. If yes, then use a second condition to see if the current date is the 24th or later in the month (the last sunday of a month with 30 days must be on the 24th or later)

 

2019-04-15_0932.png

 

**Correction** the condition 'not equals to: 02' should be 'not equals to: 2' as the value is converted to int there is no leading 0

 

You can then repeat this condition for months that have 31 days and for feburary for 28 days. I recommend putting each of these 3 master conditions in a linear fashion rather than inside each other to make for a cleaner flow.

 

For months with 31 days, the last sunday should be at least the 25th of the month and for feburary it should be at least the 22nd of the month.

 

Hope this helps,

Sam

View solution in original post

2 REPLIES 2
Highlighted
Impactful Individual
Impactful Individual

Re: Run Flow on the last Sunday each month

@Anonymous Hi,

 

The only thing I can think of is to run the flow each week on Sunday and then use a number of conditions to check if it is the last Sunday of that month. Then put any actions you wish to perfom under this condition.

 

For example you could do the following

2019-04-15_0927.png

 

Formula for 'Current Day of Month' 

int(dayOfMonth(utcNow()))

Formula for ' Current Month'

int(substring(utcNow(),5,2))

Then use a condition to see if the current month has 30 days. If yes, then use a second condition to see if the current date is the 24th or later in the month (the last sunday of a month with 30 days must be on the 24th or later)

 

2019-04-15_0932.png

 

**Correction** the condition 'not equals to: 02' should be 'not equals to: 2' as the value is converted to int there is no leading 0

 

You can then repeat this condition for months that have 31 days and for feburary for 28 days. I recommend putting each of these 3 master conditions in a linear fashion rather than inside each other to make for a cleaner flow.

 

For months with 31 days, the last sunday should be at least the 25th of the month and for feburary it should be at least the 22nd of the month.

 

Hope this helps,

Sam

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Run Flow on the last Sunday each month

Thank you @SamPo this certainly has put me on the right track and from my testing so far it works. Appreciate the detailed post, well done.

Helpful resources

Announcements
Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Top Kudoed Authors
Users online (5,734)