cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
theBrianL
Helper I
Helper I

Condition to Compare Date to Current Date

My flow gets Items  from SharePoint list.   I then have a For Each block with Condition.  On left side of condition:  

formatDateTime(items('Apply_to_each')?['Modified'],'yyyy-MM-dd'is equal to  Right side of condition:  
formatDateTime(utcNow('yyyy-MM-dd')).    This always evaluates to false even though there are items that were modified today.  Any idea how to fix? 
1 ACCEPTED SOLUTION

Accepted Solutions
v-duann-msft
Community Support
Community Support

Hi @theBrianL 

 

Thank you for posting.

 

According to your description, you would like to compare date field but always get false result. If any misunderstanding, please kindly let me know.

 

The issue is caused by incorrect expression. Please help to change right side as below:

 

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

 

v-duann-msft_0-1617600245336.png

 

Once tested, I’m able to get true if modified today.

v-duann-msft_1-1617600245341.png

 

Hope the content above may help you.

 

Best regards,

Anna

View solution in original post

2 REPLIES 2
v-duann-msft
Community Support
Community Support

Hi @theBrianL 

 

Thank you for posting.

 

According to your description, you would like to compare date field but always get false result. If any misunderstanding, please kindly let me know.

 

The issue is caused by incorrect expression. Please help to change right side as below:

 

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

 

v-duann-msft_0-1617600245336.png

 

Once tested, I’m able to get true if modified today.

v-duann-msft_1-1617600245341.png

 

Hope the content above may help you.

 

Best regards,

Anna

View solution in original post

DamoBird365
Super User
Super User

Hi @theBrianL 

 

I agree with @v-duann-msft , my tip of the month when you get something like this in the future is to stick a couple of compose actions in prior to your condition with the two individual expressions as you can then see what each side of the condition evaluates to and then potentially solve the issue yourself.  The Condition action is great for debugging your own problems and can then be removed once you are satisfied it's all working.

 

Damien

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,843)