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
Community Champion
Community Champion

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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Users online (29,919)