web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Move files in desktop ...
Power Automate
Unanswered

Move files in desktop flow based on top 100 files.

(0) ShareShare
ReportReport
Posted on by 8
Spoiler (Highlight to read)
I would like direction on how to select the top 10 files bars on sorting last modify date and copy or move them to a different folder. Using the desk top flow
I would like direction on how to select the top 10 files bars on sorting last modify date and copy or move them to a different folder. Using the desk top flow
I have the same question (0)
  • VJR Profile Picture
    7,635 on at

    You can use the Get Files action and in the Advanced section it will have an option to Sort by the modified date and choose the Descending switch as per your requirement.

    This will give a Datatable called Files. Loop through the Files datatable for 10 times as you copy/move the files.

     

    VJR_0-1658285042824.png

     

  • sbrownsecuretra Profile Picture
    8 on at

    how do I apply the loop? 

     

  • sbrownsecuretra Profile Picture
    8 on at

    It continues to bring over all the files instead of one at a time. 

    sbrownsecuretra_0-1658323058373.png

     

  • VJR Profile Picture
    7,635 on at

    Follow the pseudo logic.

    -Set variable counter =1

    -Get files in folder

    -for each loop on %files%

    If counter<=10 then

    Copy files (make sure here you use current item and not %Files% as you have used which is causing everything to get copied) 

     

    End if

    Increase variable counter by 1

    -end of for each loop

     

  • ryule Profile Picture
    929 Super User 2024 Season 1 on at

    Here's the PAD version of VJR's post. Be sure the "Get files in folder" is sorted how you want it

    ryule_0-1658330749977.png

     

  • sbrownsecuretra Profile Picture
    8 on at

    That worked!!! Thank you very much for your help. 

    sbrownsecuretra_0-1658331798594.png

     

  • VJR Profile Picture
    7,635 on at

    Be noted in your code Counter starts from 1 and the "IF" condition is <=10 which means 0 to 10. It will process 11 documents.

     

    Either have:

     

    Counter = 1

    If Counter <=10

     

    OR

     

    Counter = 0

    If Counter <10

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 632

#2
Haque Profile Picture

Haque 458

#3
Valantis Profile Picture

Valantis 357

Last 30 days Overall leaderboard