cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
michael80321
Level: Power Up

How can I set recurrence with the last day of month?

I want to set a recurrence with the last day of month. Is it possible?

 

I know how to set the specific date in the following link

https://powerusers.microsoft.com/t5/General-Flow-Discussion/Is-there-a-way-to-get-a-monthly-reminder...

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: How can I set recurrence with the last day of month?

Hi @michael80321.

 

Today we no have a simple way to do this, but i created a function that does,

 

The first print is my result and second is how i did. In my case just to explain i used a compose, but a the utcNow() function get the last day of current month

 

The function is the below:

 

"@adddays(concat(add(int(formatDateTime(utcNow(), 'yyyy')),if(equals(formatDateTime(utcNow(), 'MM'), '12'), 1, 0) ),'-',add(int(formatDateTime(utcNow(), 'MM')),if(equals(formatDateTime(utcNow(), 'MM'), '12'), -11, 1) ),'-01T00:00:00Z'),-1)"

 

I create a idea for do this more simple, please vote on it 

 

Flow1.pngFlow2.png

 

I hope i have helped.

 

Best Regards,

 

Gustavo Moraes

 


Did I answer your question? Mark my post as a solution!

Gustavo Moraes, o astronauta brasileiro do Flow!


View solution in original post

9 REPLIES 9
Super User
Super User

Re: How can I set recurrence with the last day of month?

Hi @michael80321.

 

Today we no have a simple way to do this, but i created a function that does,

 

The first print is my result and second is how i did. In my case just to explain i used a compose, but a the utcNow() function get the last day of current month

 

The function is the below:

 

"@adddays(concat(add(int(formatDateTime(utcNow(), 'yyyy')),if(equals(formatDateTime(utcNow(), 'MM'), '12'), 1, 0) ),'-',add(int(formatDateTime(utcNow(), 'MM')),if(equals(formatDateTime(utcNow(), 'MM'), '12'), -11, 1) ),'-01T00:00:00Z'),-1)"

 

I create a idea for do this more simple, please vote on it 

 

Flow1.pngFlow2.png

 

I hope i have helped.

 

Best Regards,

 

Gustavo Moraes

 


Did I answer your question? Mark my post as a solution!

Gustavo Moraes, o astronauta brasileiro do Flow!


View solution in original post

michael80321
Level: Power Up

Re: How can I set recurrence with the last day of month?

Hi Gustavo,

 

I try it, but nothings to display. Am I Doing it Wrong? Thanks a lot.

 

 

 

 

Super User
Super User

Re: How can I set recurrence with the last day of month?

Hi michael,

the second print don't show but you need put " after and before compose text, only this Microsoft Flow interpret as function. Copy all bold text than I post and put in your compose.

Best Regards,

Gustavo Moraes

Did I answer your question? Mark my post as a solution!

Gustavo Moraes, o astronauta brasileiro do Flow!


michael80321
Level: Power Up

Re: How can I set recurrence with the last day of month?

Thank you very much !!!

It works : )

rosshartley
Level: Powered On

Re: How can I set recurrence with the last day of month?

I took a slighly different approach.

 

At 2pm daily, my flow checks to see if today's date is less than tomorrows date. If it's not, then tomororw is the first day of a new month.

 

It specifically extracts the day of the month only.

 

Having said this, I haven't actually let it run past the end of a month yet... It should work but I havne't proven it yet Smiley Very Happy

End of month flow.jpg

 

On the left of the condition is this: 

convertFromUtc(utcNow(),'W. Australia Standard Time','dd')
 
On the right of the condition is this:
adddays(convertFromUtc(utcNow(),'W. Australia Standard Time'),1,'dd')

 

NielsL
Level: Powered On

Re: How can I set recurrence with the last day of month?

@rosshartley ,

 

Did your flow run successfully when it ran past the end of April? 

 

If it did - that's a very smart workaround - but it's really difficult to test 🙂 

Highlighted
rosshartley
Level: Powered On

Re: How can I set recurrence with the last day of month?

Yes it did! Smiley Very Happy

 

It is a bit tricky to test though... Apart from being very patient...

 

I'd kind of tested it by changing the 'Is Less Than' to 'Is Greater Than' and the flow still worked, but in the opposite direction.

NielsL
Level: Powered On

Re: How can I set recurrence with the last day of month?

@rosshartley

 

That's great.

 

I guess there are other ways to test it. However, you can't really be sure until you see it working with the specific logic. 

 

I'm creating a flow right now based on your solution. Then I'll wait until June to see if it works Man LOL 

 

Thanks for your input. 

dmistry
Level 8

Re: How can I set recurrence with the last day of month?

@gamoraes  Excellent, thank you for this. I needed it badly. Question, what if I just need yyy-mm-dd as ouput and discard the time zone stamp, what would be the adjustment to the formula. Thanks in advance.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 199 members 5,104 guests
Please welcome our newest community members: