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

How to check if a file has not been updated

Hello there,

I would really appreciate if someone could help me. My problem is the following:

First of all, I have a process that every 5 minutes updates the content of two excel files that I have in the same Onedrive folder. But this process fails sometimes, and I need to check when it has not updated the files.

To perform this check I want to use Power Automate Desktop. I want to create a flow that every time I run it checks if the update date-time of the files is more than 10 minutes earlier than the current one. And if that condition occurs (that is, only if the date-time of the files is 10 minutes older than the current one), Power Automate should send me an email notification.

That is the important part of what I want to do.

Then I will insert that flow into a loop, adding before the end of the loop a pause of approximately 9min50ss, and thus the loop will repeat itself more or less every 10 minutes. And if I program it to loop about 4,500 times, it will be enough for me to check it once a month to reset the counter back to 4,500.

My problem is, for one thing, I don't know how to tell Power Automate Desktop how to check the last modified date-time of a file. I have tried "Get Files in Folder" and "Set variable" but no success. I clarify that this could be done by checking the date-time of the files in the computer folder or in Onedrive's cloud service.

On the other hand, I also don't know how to tell Power Automate Desktop to compare that date-time with the current one. In this case I think I have found information to do it with Power Automate cloud flows, but not with the Desktop version.

Just in case I indicate that I have OneDrive configured with the Paris time, as well as the computer. I'm saying this because I also don't know if it is necessary to tell Power Automate to take the time zone into account.

And finally, if it's easier, I have no problem checking only one of the two files, because when the update process fails, it fails both. On the other hand, if it's convenient, I could also store each file in different folders.

Thank you very much for your help.

1 ACCEPTED SOLUTION

Accepted Solutions
MichaelAnnis
Super User
Super User

Files have the property "LastModified".  So, you can do this:

 

MichaelAnnis_0-1629991128526.png

The biggest issue was that the If command will not compare Dates/Times, so you have to convert the DateTimes to text -> standard format -> sortable.  This gives them a numeric value that can be compared.

 

Best of luck!

 

 

 

 

 

View solution in original post

2 REPLIES 2
MichaelAnnis
Super User
Super User

Files have the property "LastModified".  So, you can do this:

 

MichaelAnnis_0-1629991128526.png

The biggest issue was that the If command will not compare Dates/Times, so you have to convert the DateTimes to text -> standard format -> sortable.  This gives them a numeric value that can be compared.

 

Best of luck!

 

 

 

 

 

MichaeI, a very clear proposal.

I had to change your flow a bit, because the Subtract Dates step was not working for me. I have done it like this:

 

Joxe_0-1630236374567.png

 

Thank you very much!

 

Joxe

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
Top Kudoed Authors
Users online (1,885)