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

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

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!



Community Support Team
Community Support Team

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.

Community Support Team
Community Support Team

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
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 (4,910)