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

Condition to compare dates in sharepoint

Hi All

 

I am trying to create a flow that is coping items from one SharePoint to another by comparing today's date to the date of the item and if matches it copied the entire item to a different list

Comparing 

this is my condition: 

formatDateTime(triggerBody()?['Start_x0020_Date_x0020_At_x0020_'],'yyyy-MM-dd')  is equals to formatDateTime(utcNow(),'yyyy-MM-dd')
It does not seem to work this way...anyone have a better understanding of how to accomplish that?
 
Please help
 
 

 

4 REPLIES 4
Super User
Super User

Re: Condition to compare dates in sharepoint

@rory99 :

You probably want to use the equals expression which you'll find under logical functions:

equals(formatDateTime(triggerBody()?['Start_x0020_Date_x0020_At_x0020_'],'yyyy-MM-dd'),formatDateTime(utcNow(),'yyyy-MM-dd'))
 
If this addresses your issue, please mark your post as Solved.
 
Scott
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
rory99
Level: Powered On

Re: Condition to compare dates in sharepoint

Maybe I'm missing something here...my condition looks like this:

 

Capture.PNG

how do I change it to a logical function?

Super User
Super User

Re: Condition to compare dates in sharepoint

@rory99 

I did not realize that you had this is a condition as there was no screen shot.

 

I don't see anything wrong with your logic or formatting.

 

When you say it doesn't work, are you saying that is never true or are you saying that it errors out?

 

One suggestion that I have:

Create two string variables.  Set the values of each string variable to the results of one of your formatDateTime expressions.  Run the Flow and view the results in the history.  Do the values in the variables appear to be the same?

 

Scott

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

Scott
rory99
Level: Powered On

Re: Condition to compare dates in sharepoint

Hi Scott

 

It does not work since the condition result is always false

I actually tried to create two differetn strings and did see that they indeed match for some of the items

 

 

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

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

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 Flow Community Video Gallery!

Users Online
Currently online: 201 members 4,621 guests
Please welcome our newest community members: