Hi all,
I'm looking for help in selecting records by an expiry field. I"m needing to send three emails to clients, and the first email is 6 weeks/42 days before the expiry, then another at 4 weeks/28 days before expiry and the final at 2 weeks/14 days before expiry.
So far the best way that I've seen to do this is using an expression of greater than and less than. Which I think would be using the context of Greater Than today & Less than today + 42 days
Would this work towards what I am doing?
This is the formula that I've seen with this:
(starttime gt addDays(body('UTC_Start_of_Day'),1,'yyyy-MM-ddTHH:mm:ssZ')) and (starttime lt addDays(body('UTC_Start_of_Day'),2,'yyyy-MM-ddTHH:mm:ssZ'))
https://www.arbelatech.com/insights-resources/blog/microsoft-flow-how-to-query-dynamics-365-date-tim...
Solved! Go to Solution.
Hi @Tarjani
Thank you for posting.
According to your description, you would like to send several emails to user depends on expiry date. If I misunderstood, please kindly let me know.
I will use date info from SharePoint list as data source for your reference:
Seems you are using filter query, but I use three level conditions instead for better to understand.
Flow overview:
In first condition, we need to check whether today equals 6weeks before the ExpiryDate value. If yes, we send first email notification 6weeks in advance.
In condition 2, we need to use similar condition to check whether today equals 4weeks before the ExpiryDate value. If yes, send 2nd email 4 weeks in advance.
In condition 3, configure condition for 2 weeks in advance.
Related expression:
formatDateTime(items('Apply_to_each')?['ExpiryDate'],'yyyy-MM-dd')
formatDateTime(addDays(utcNow(),42),'yyyy-MM-dd')
formatDateTime(addDays(utcNow(),28),'yyyy-MM-dd')
formatDateTime(addDays(utcNow(),14),'yyyy-MM-dd')
Hope the content above may help you.
Best regards,
Anna
Hi @Tarjani
Thank you for posting.
According to your description, you would like to send several emails to user depends on expiry date. If I misunderstood, please kindly let me know.
I will use date info from SharePoint list as data source for your reference:
Seems you are using filter query, but I use three level conditions instead for better to understand.
Flow overview:
In first condition, we need to check whether today equals 6weeks before the ExpiryDate value. If yes, we send first email notification 6weeks in advance.
In condition 2, we need to use similar condition to check whether today equals 4weeks before the ExpiryDate value. If yes, send 2nd email 4 weeks in advance.
In condition 3, configure condition for 2 weeks in advance.
Related expression:
formatDateTime(items('Apply_to_each')?['ExpiryDate'],'yyyy-MM-dd')
formatDateTime(addDays(utcNow(),42),'yyyy-MM-dd')
formatDateTime(addDays(utcNow(),28),'yyyy-MM-dd')
formatDateTime(addDays(utcNow(),14),'yyyy-MM-dd')
Hope the content above may help you.
Best regards,
Anna
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
72 | |
26 | |
20 | |
15 | |
15 |
User | Count |
---|---|
143 | |
44 | |
42 | |
34 | |
32 |