Showing results for 
Search instead for 
Did you mean: 
Level: Powered On

Recurring flow to find a file in a document library

I have a recurring flow scheduled every Monday at 5pm to find the LAST MODIFIED file in the document library. The recurring action is pretty forward but I need help about finding the last modified file.


The goal is once the flow find this last modified file it will make a duplicate copy with a different filename which I know how to do. Thank you in advance.

Level: Powered On

Re: Recurring flow to find a file in a document library

The HILL document library's path is located at

Community Support Team
Community Support Team

Re: Recurring flow to find a file in a document library

Hi @NBMS_2019,


I have made a test on my side and the flow works well. Please take a try with the following workaround to find the last modified file:

Convert the Modified value to a value using the ticks() function, then add it to an array.

Append to array variable-Expression: 



Use the max() function to find the maximum value of the array, which is the value of the most recent modified time conversion.

Then determine which Moidfied this value is, and then find out the relevant information for that file.

Compose action-Expression: 


Condition action-Expression: 



The flow works successfully as below, 'yu' is the name of the file that was last modified before the time set by my trigger:


According to the information obtained in the above step, you can make a duplicate copy with a different filename which you know how to do.

Please take a try and feel free let me know if you have any question.


Best Regards,


Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Level: Powered On

Re: Recurring flow to find a file in a document library



I am an intermeadiate user of flow, so here goes with a query.


I have a Sharepoint List, that I want to trigger and action on like send email containing a CSV file.  I am okay with the sending an email with a CSV attachment but I want to get the flow to run every three days from the start time and then end after a number of occourances, say 10 or when the feedback of the event has dried up i.e. 10 days.  The flow should then terminate and stop running. 


I am have not used any expressions in flow yet so the above maybe possible with that but it is the actual flow diagram I need.  We can split the flow into multiple sections if required if that would help the logic.


Any guidance would be helpful.





Helpful resources


New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!


Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!


Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!


Microsoft Learn

Learn how to build the business apps that you need.


Power Platform World Tour

Find out where you can attend!


Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,692)