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

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (1,647)