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

If date is in two weeks, send email automation flow

Hi,

How do I get my flow to send an email if a date is approaching in two weeks? This is what I currently have but its not working. Is there an error in the condition or the variable? 

 

Variable initialized: 

formatDateTime(addDays(utcNow(),14),'yyyy-MM-dd')

AB68_0-1638544850670.png

 

Condition: 

Date is Less than or equal to formatDateTime(addDays(utcNow(),14),'yyyy-MM-dd')

 

Thanks in advance. 

4 REPLIES 4
abm
Super User
Super User

Hi  @Anonymous 

 

Both dates needs to be formatted to yyyy-MM-dd. 

 

Thanks



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

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
ManishJain
Solution Sage
Solution Sage

Hi @Anonymous, 

 

formatDatetime gives you output in string whereas if you are comparing output of this with actual datetime field it wont work . You need to format your date time field to the same format before putting your logic there.

 

Thanks

 

Anonymous
Not applicable

Hi @ManishJain and @abm. Thank you for your responses. 

 

I fixed the formats of the dates. Is the condition correct or should this be changed too? 

Hi @Anonymous 

 

Could you provide an example? The issue for your current condition is checking the date which is todays date always going to be less than 14 days ahead. 



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

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,159)