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 / Is it possible to copy...
Power Automate
Answered

Is it possible to copy/move only the most recent file (Last modified) in a folder using Power Automate Desktop? How can I do it?

(0) ShareShare
ReportReport
Posted on by 9

Is it possible to copy/move only the most recent file (Last modified) in a folder using Power Automate Desktop? How can I do it?

I have the same question (0)
  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    You could try this:

    1) Use 'Get Files in Folder' with the folder you want to work. In Advanced options, order by 'Last modified'. This will give you a list where the 1st item is the last modified file in the folder ('%Files%' variable).

    2) Then use the action 'Copy Files' or 'Move Files' w/ first item of the previous list as parameter - %Files[0]%.
    I use PAD in a non-english version, so not sure if I translated the actions' names correctly.

  • Ricardor Profile Picture
    9 on at

    Ty my bro!!

  • sonam1996sahoo Profile Picture
    143 on at

    Hi, @Anonymous 

    I tried this solution but it is not working. It is showing me an error that The query is not valid.
    clientRequestId: a8959e0e-a9e7-4cc3-9ca9-ab91b3fc23e2
    serviceRequestId: a8959e0e-a9e7-4cc3-9ca9-ab91b3fc23e2

     

    power automate copy latest file.pngcopy latest file using Power Automate.png

    May I know the reason?

  • Kamacete Profile Picture
    160 on at

    Hi,

    Same problem here.

    I need to get the last file created in a share drive folder (folder A) with the name "test_2022-09-15.xlsx" and copy to another folder (folder A) with the name of "test_lastFileUpdated.xlsx", and replace this the file (folder B) every time a new file is added on Folder A

    Can someone help please?

  • pmmredlana Profile Picture
    4 on at

    Use Modified instead of 'Modified' in the ODATA query.

  • Kamacete Profile Picture
    160 on at

    Thank you very much.

    But this will copy the file with the same name that we have on the original one. However, I have to copy to a different name.

    E.g.:

    from: file2022-09-20.xlsx

    To: file_final.xlsx

  • cpkhoi Profile Picture
    16 on at

    I'm so sorry but can anyone help me?

     

    This is my screen for the "copy files" but there's no "advanced options"? Am I missing something? Or using a different version?

    Automate.jpg

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    It’s in get files. 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 247 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 164 Super User 2026 Season 2

#3
trice602 Profile Picture

trice602 138 Super User 2026 Season 2

Last 30 days Overall leaderboard