cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
joshclarkee94
New Member

Using dates in Conditions

Hi everyone, 

 

I'm new to Power Automate and trying to create a scheduled flow that will check how long it has been since a collection of SharePoint files in a single location have been modified and react accordingly. However, the results I'm getting from the conditions are very hit and miss in terms of running as expected.

 

I have a set of variables that I use formatDateTime and Convert Time Zone functions on - These create the benchmark dates I will use to define the age of a file. I then use Convert Time Zone within the Apply to each function to ensure each files date is aligned before comparing through conditions. 

 

My current single file test example runs as so:

 

Condition 1 - File Converted Time (3/1/2021) >= Benchmark Date 1 (5/1/2020)

NO - Proceed to C2

Condition 2 - File Converted Time (3/1/2021) <= Benchmark Date 1 (5/1/2020) && File Converted Time > Benchmark Date 2 (3/31/2020)

NO - Proceed to C3

Condition 3 - File Converted Time (3/1/2021) <= Benchmark Date 2 (3/31/2020) && File Converted Time > Benchmark Date 3 (2/29/2020)

SUCCESS

 

Am I missing a key piece in the puzzle to have my dates work as expected? 

 

Thanks in advance for your help,

Josh

1 ACCEPTED SOLUTION

Accepted Solutions
tom_riha
Super User
Super User

Hello @joshclarkee94 ,

I'd try to use the standard ISO 8601 format for all the dates, 'yyyy-MM-dd', it might help.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

2 REPLIES 2
tom_riha
Super User
Super User

Hello @joshclarkee94 ,

I'd try to use the standard ISO 8601 format for all the dates, 'yyyy-MM-dd', it might help.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

Hi @tom_riha ,

 

That seems to have done the trick. Thanks a lot for your time and support. 

 

Regards,

Josh

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,216)