Bijan
Bijan

Reputation: 8586

Power Automate: Send reminder out 3 months in advance

I have a Microsoft List that has a column called Expiration Date (text in format of MM/DD/YYYY) and Point of Contact (text in format of [email protected]). How do I create a flow that sends an email out to the Point of Contact 3 months in advance?

My idea was to create a scheduled cloud flow that:

  1. Repeats every day
  2. Looks at every row in specific list
  3. Compares if Expiration Date - 3 Months = Today
  4. If True, send email to Point of Contact

I am currently stuck on step 3 to compare the date. I did Subtract from time to subtract 3 months from Expiration Date but now I do not know how to use this value to compare to today's date.

Upvotes: 0

Views: 3701

Answers (1)

carlosherrera
carlosherrera

Reputation: 187

A better approach is to filter the list by using an OData filter. That will result in a list with all the elements you need.

For doing so, you need to specify the "Filter Query" field (in red):

Filter Wuery example

First type

ExpirationDate eq ''

Then, between the quotes, add an expression, and select the functions addDays and utcNow in the following way:

addDays(utcNow(),92,'MM/dd/yyyy')

Please notice the following:

  1. I'm adding 92 days to get the same day three months in advance for today (today is Oct 18th, so I'm looking for Jan 18th). Maybe adding just 90 days would work for you.
  2. If you just want to add 3 to the month, you would need to get today's date to a variable with utcNow('MM') to get only the month, add 3 to it, and then create the expression accordingly.
  3. I'm sorry the UI is in spanish. I'm from Mexico. But it's the same idea.
  4. In the image, it reads "ExpirationDateText" because that's the way I named the field in my example. In your case, "ExpirationDate" should work.

Upvotes: 1

Related Questions