cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PhineasT
Helper IV
Helper IV

Adjust Flow to Send After 30 Days

I finally got this to send my test email account an email.

Can someone help me edit the flow so that it only sends emails to the desired individuals where 30 days has passed since the 'DateOfEvent'? The flow is sent to run every 24 hours.


PhineasT_1-1652839468751.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @PhineasT ,

if it should send the email only once exactly 30 days after the event the operator will be 'eq' = equals. But with equals condition you must also format the date you're comparing it with.

DateOfEvent eq '@{addDays(utcNow(),-30,'yyyy-MM-dd')}'

You can find more on the filtering by date here.

For the other column, FirstSDEmailSent, it depends what type of column it is. If it's a choice column you can compare it to Yes/No values, but if it's a Yes/No column type then you must compare it with values 1/0, e.g.

FirstSDEmailSent eq 1 and DateOfEvent eq '@{addDays(utcNow(),-30,'yyyy-MM-dd')}'


[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

3 REPLIES 3
tom_riha
Super User
Super User

Hello @PhineasT ,

instead of getting all the items and then filtering them using a 'Condition' you can use the Filter Query directly in the 'Get items' action. It allows you to define a condition with what items you want to return, which in your case might look like:

DateOfEvent lt '@{addDays(utcNow(),-30,)}'

Such Filter Query will return only items where the DateOfEvent is less than today - 30 days (= more than 30 days ago)

You can find more about the date calculations in this blog post.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

Thank you for your assistance.

If the flow runs every day, won't it send an email every day using your recommendation, as once its more than 30 days it will always be at least more than 30 days? I only want to send one reminder to each member that qualifies at the 30 day mark.

Also, I can't get this to work - 

             (FirstSDEmailSent eq 'Yes') and (DateOfEvent lt '@{addDays(utcNow(),-30,)}')

Hello @PhineasT ,

if it should send the email only once exactly 30 days after the event the operator will be 'eq' = equals. But with equals condition you must also format the date you're comparing it with.

DateOfEvent eq '@{addDays(utcNow(),-30,'yyyy-MM-dd')}'

You can find more on the filtering by date here.

For the other column, FirstSDEmailSent, it depends what type of column it is. If it's a choice column you can compare it to Yes/No values, but if it's a Yes/No column type then you must compare it with values 1/0, e.g.

FirstSDEmailSent eq 1 and DateOfEvent eq '@{addDays(utcNow(),-30,'yyyy-MM-dd')}'


[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

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.

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.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (1,746)