cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NBMS_2019
Helper I
Helper I

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.

3 REPLIES 3
NBMS_2019
Helper I
Helper I

The HILL document library's path is located at

 

https://admin.sharepoint.com/sites/REST/Mountain/HILL

v-bacao-msft
Community Support
Community Support

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: 

ticks(items('Apply_to_each')['Modified'])

4.PNG

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: 

max(variables('Modified'))

Condition action-Expression: 

ticks(items('Apply_to_each_2')['Modified'])

5.PNG

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

6.PNG

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,

Barry

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.

All,

 

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.

 

Regards,

 

Andrew

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.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

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.

Users online (2,203)