cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Sharepoint list Dates comparission with Today

Hello all,

 

I have a sharepoint list that has a column formated as Date Only and I'm trying to build a flow that compares the Dates at that column with today date. I think I got it all correct but the condition always consider it false.

 

So this is the list and as you could see one date is "23/04/2020" equals to today.

 
 

This is the flow, I put that compose step in the middle to see if the expression is getting the correct value.

My expression is formatdatetime(utcnow(),'dd/MM/yyyy') to get the same format as it at sharepoint list.

 

2.PNG

3.PNG

 

Testing the flow, I can see that the expression is getting the same exact value as the list, but at the end I get 2 times false and the first date should get true:

4.PNG5.PNG

 

Someone can help me with this?

 

Thanks!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-alzhan-msft
Community Support
Community Support

Hi @Anonymous ,

 

You could troubleshooting your flow by add a Compose 2 action before the Condition and inside the Apply to each, save the date column dynamic content inside the Compose 2, run the flow and check the value in the output of the Compose, then your issue could be solved.

1.png

 

Best regards,

Alice   

Community Support Team _ Alice Zhang
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

6 REPLIES 6
efialttes
Super User
Super User

Hi!

TRy with

 

formatDateTime(utcNow(),'yyyy/MM/dd')

 

I would also suggest to replace operator equals and use contains instead, even though equals should be OK

 

Ánimo!

#YoMeQuedoEnCasa



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



ScottShearer
Super User
Super User

@Anonymous 

I believe that you'll need to use the format yyyy-MM-dd as that is how SharePoint stores the dates internally

formatDateTime(utcNow(),'yyyy-MM-dd')

 

Also, you'll likely be better off using an OData filter rather than a condition.  That way, only those items that meet your requirement will be returned - no need for a condition.  Substitute the internal name of your date column for MyDate in the example below:

OData1.jpg

 

 

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

Scott
v-alzhan-msft
Community Support
Community Support

Hi @Anonymous ,

 

You could troubleshooting your flow by add a Compose 2 action before the Condition and inside the Apply to each, save the date column dynamic content inside the Compose 2, run the flow and check the value in the output of the Compose, then your issue could be solved.

1.png

 

Best regards,

Alice   

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

 

Anonymous
Not applicable

Hey,

 

Thanks for the reply, it's still not working 😕

Hi @Anonymous ,

 

Could you please create the flow same as mine and share the screenshot of the run history of the flow, including the Compose and the Compose2 in the screenshot?

 

Best regards,

Alice   

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

Anonymous
Not applicable

Hey @v-alzhan-msft ,

 

Yes I've done it and I figured it out the error, but still have an issue now.

 

So to start let me explain you more about the list, I've got two date, the first column is the due date and the next one is a calculated column, formated as date only that is doing the [DataCaducidade]-15. Because I want to notify an e-mail when 15 days left to the due date:

1.PNG

 

Doing the compose function that you recommend me, I figure out that is returning the date that I've created the entry on the list, with hours included:

2.PNG

 

So now I'm trying to do the subtraction on power automate with the following expression, but is getting me an error:

addDays(triggerBody()?['DataCaducidade'],-15)
3.PNG
I've tried a compose with the due date ([DataCaducidade]) and I could see that is returning the correct value, the date in formate yyyy-MM-dd.
 
Could you help me with these?
 
Thanks in regard!

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (3,745)