cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jswanson1
Frequent Visitor

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
v-bacao-msft
Community Support
Community Support

 

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
Pstork1
Dual Super User III
Dual Super User III

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.

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.

Pstork1
Dual Super User III
Dual Super User III

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
Super User
Super User

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

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

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





v-bacao-msft
Community Support
Community Support

 

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (3,434)