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 / How to retrieve the re...
Power Automate
Answered

How to retrieve the recent file in Power Automate Desktop

(0) ShareShare
ReportReport
Posted on by 517

Hello,

how can I retrieve the last (most recent) file added to the folder?
I have tried this If Statement

dkayt_0-1699542911238.png

but it does not help me achieve the goal I want to achieve.

Can anyone point me in the right direction?

Regards,

d'Kayt

  • Verified answer
    Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @dkayt 

     

    a simple method would help 🙂

     

    Nived_Nambiar_0-1699543328942.png

     

    here i am using get files in folder action to get list of all files which would be sorted by creation time in descending order 🙂

    Nived_Nambiar_1-1699543375034.png

     

    Nived_Nambiar_2-1699543388356.png

     

    Nived_Nambiar_3-1699543399221.png

     

     

    Now the output is stored in %Files% variable, Now use %Files[0]% to retrive a most recent file 🙂

     

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

  • Verified answer
    Pavel_NaNoi Profile Picture
    1,074 on at

    in the "Get files in folder" action you can go into "advanced" and sort by what you want, in this case, creation time. this will generate a list, simply set a variable to %Files[0]% and you'll have the latest file.

  • dkayt Profile Picture
    517 on at

    @Nived_Nambiar and @Pavel_NaNoi 

    Thank you  guys for your quick answer. Your solutions work very well. Have a nice weekend.

     

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

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 237 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 227 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 194

Last 30 days Overall leaderboard