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 II
Super User II

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 II
Super User II

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

Top Solution Authors
Users online (68,934)