cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jswanson1
Level: Powered On

Sending an email when an expiration date is approaching.

I am having trouble with the expression that allows and email to send when an expiration date is coming up, say 30 days prior to expiration. 

expiration flow.PNG

 

I have the "output is equal to today" send an email on the expiration day, but I would like to have an additional or "if today is 30 days prior to the expiration date" expression, but every one I find online doesn't seem to do what I need it to.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Sending an email when an expiration date is approaching.

 

Hi @Jswanson1 ,

 

Please refer to the following method:

111.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Dual Super User
Dual Super User

Re: Sending an email when an expiration date is approaching.

This problem is very common.  The issue is that dates are stored as DateTime values.  There is always a time component.  That is true for the output of UTCNow() also.  Since the times involved are measured down to the millisecond the chance that you will get an actual equals condition is almost nil.  What you need to do is extract the Date portion of the value from both sides of the condition and compare just htat.  You can do that using a DateTimeFormat() function like this.

formatDateTime(UTCNow(),'D')

For the left side replace UTCNow with the date time field.   This will return both values as a string which can then be compared.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Jswanson1
Level: Powered On

Re: Sending an email when an expiration date is approaching.

I understand that part, and I currently have that as one of my "or" conditions.

The other or condition needs to be something like 30 days prior to expiration equals today and I can't seem to get the 30days prior part.

Highlighted
Dual Super User
Dual Super User

Re: Sending an email when an expiration date is approaching.

For the thirty days prior use the AddDays() function with -30 as the number of days.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Jcook
Level 8

Re: Sending an email when an expiration date is approaching.

Yes,

Use a data compose action to have the UTC(now) add days + 30 expression. Than compass the output of the action to the SharePoint expire date.

-Josh
Community Support Team
Community Support Team

Re: Sending an email when an expiration date is approaching.

 

Hi @Jswanson1 ,

 

Please refer to the following method:

111.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,294)