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. ]

Hi @tom_riha ,

 

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

 

Regards,

Josh

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!

Top Solution Authors
Users online (1,834)