cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kk_15
Regular Visitor

send email on last monday of every month. The email should include all saturdays of next month.

I want to send email on last Monday of every month. The email content should include all Saturdays of next month.

For example: If the email is sent on 25th April 2022 

should get dates :  7th May ; 14th May ; 21st May ; 28th May 

Kindly post the solution with pictures/steps. Thanks in advance   

3 REPLIES 3
GeorgiosG
Super User
Super User

Hi @kk_15 ,

 

I found a great solution already in our community.

You can use a daily trigger and have this condition included https://powerusers.microsoft.com/t5/Building-Flows/How-can-I-find-the-last-Friday-of-the-month-for-a...

 

In your case you don’t have to compare the day of week to 5, obviously you need to use 1.

For getting the Saturday’s, you also can reuse the condition but adapt some steps.

 

Inside of your first true condition, create a second condition like in my screenshot. Do the same condition like above but add 5 days on the utcNow() for that you can use a new variable called Saturday. Now you have to use in the condition not 1, use 6 (Saturday). 

 

If your condition is true, the next Saturday will be in this month and you can use 3 addDays Method. If not true, the next Saturday ist in next month and you have to use 4 addDays()

Expression Examples:

formatDateTime(addDays(variables('saturday'),7),'MM')

formatDateTime(variables('saturday'), 'MM')

dayOfWeek(variables('saturday'))

addDays(variables('saturday'),7)

addDays(variables('saturday'),14)

addDays(variables('saturday'),21)

addDays(variables('saturday'),28)

 

8D7BFC6A-879E-4100-9503-0A212019CEFD.jpegC3FA4C75-6CE0-4F8B-92E3-FF67AC688FE3.jpeg

 

Whole flow can look like this

GeorgiosG_0-1651044999820.png

 


Hope this helps you.

Happy to help.
If I have answered your question, please mark your post as Solved.

Thanks @GeorgiosG for providing the solution. However the link provided ( https://powerusers.microsoft.com/t5/Building-Flows/How-can-I-find-the-last-Friday-of-the-month-for-a...) dint work as I tested.

Moreover I want to automatically get all Saturday's for next month if I want to send an email on the last Monday of every previous month. 

It looks like we have hardcoded the dates here: 

addDays(variables('saturday'),7)

addDays(variables('saturday'),14)

addDays(variables('saturday'),21)

addDays(variables('saturday'),28)

 

Apologies if I have not understood your logic correctly.

Many thanks for your help once again. Much appreciated

 

kk_15
Regular Visitor

How do I get only dates from this filter array results:

 

[{"Date":"04-Jun","Day":"Saturday"},{"Date":"11-Jun","Day":"Saturday"},{"Date":"18-Jun","Day":"Saturday"},{"Date":"25-Jun","Day":"Saturday"}]

 

Output should be :

04 Jun

11 Jun

18 Jun

25 Jun

 

Thanks in advance

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.

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022- Season 2 has kicked off!

Users online (4,631)