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

Trying to do a condition based on date

I am trying to create a simple condition that does things different depending on the date submitted (field in SharePont) + 5 days.  I would rather do business days, but that looks far more complex to calculate.  The condition that I have setup that isn't working is:

 

Expected Date (field in SharePoint list)

Is less than (condition)

formatDateTime(addDays(utcNow(), +5), 'MM/dd/yyyy') (expression)
 
Everything I route through this formula no matter what the date is, is that it is not less than or equal to 5 days.  Unfortunately since SharePoint doesn't seem to do previews of expressions to see what they are calculating, I can't really tell the issue.
3 REPLIES 3
Highlighted
Super User III
Super User III

Re: Trying to do a condition based on date

Hi @DCurzio

 

Are you formatting the expected date in the format?

 

If you want to see the format expression value then add a compose step and set the expression formatDateTime(addDays(utcNow(), +5), 'MM/dd/yyyy'). Use the compose output to compare the value against the expected date. This way you can see the runtime values from the run history.

 



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
Highlighted
Community Support
Community Support

Re: Trying to do a condition based on date

Hi @DCurzio,

 

The date column format in the SharePoint is 'yyyy-MM-dd', so when comparing it with the utcNow + 5 days, the formate fuction should input 'yyyy-MM-dd', please follow as blew shows, use the formatDateTime(addDays(utcNow(), +5), 'yyyy-MM-dd') instead of formatDateTime(addDays(utcNow(), +5), 'MM/dd/yyyy').Annotation 2019-10-23 152804.png

 

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

Highlighted
Community Support
Community Support

Re: Trying to do a condition based on date

Hi @DCurzio,

 

Has your problem been solved?
If your problem has been solved, You could go ahead and mark the post as solved by clicking “Accept as Solution” so that this thread will be marked for other users to easily identify!

Best Regards,
Community Support Team _ Lin Tu

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Users online (7,117)