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.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

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

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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,756)