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
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
Users Online
Currently online: 369 members 6,524 guests
Please welcome our newest community members: