We have 2 folders...
Folder 1: Used to store a daily data output fileS (.xlsx) in. Each daily file is named similar to "Daily_Spend_Service_20200828_000148", but with the date section changing.
Folder 2: Used by Power Bi to refresh a data report. Power Bi looks for a file called "Upload" in the folder.
We need a flow to copy the most recent file found in Folder 1 and copy it to Folder 2, once the most recent file is in folder 2, delete the previous file called "Upload" from folder 2 and rename the newly copied file to "Upload".
Is this possible? Very new to creating Flows, so any guidance would be great.
Hi!
In order to copy newest file from folder 1 to folder 2 I would do the following:
Set 'Get files (properties only)' by selecting target site, library name and folder... Set 'Top Count' input to 1 and type the following ODATA expression to 'Order by' input
Created desc
Next add an 'Apply to each' action block, assign as its input 'Get files (properties only)' value output... this 'Apply to each will be executed 1 time only, since 'Top Count' was set to 1
Now inside the Apply to each I would add 'Copy file' action block. GReat stuff in this article on this action block
Once you get this part running please let us know so we will work on renaming and deleting
Hope this helps
Sorry, yes, both folders are located in Sharepoint Documents...
Documents\Folder 1
Documents\Folder 2
Yes we can!
But, we need some more context info...
Onedrive? Onedrive4Business? Sharepoint?
Thanx!
Michael E. Gernaey
566
Super User 2025 Season 1
David_MA
516
Super User 2025 Season 1
stampcoin
492