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 / Open last modified fil...
Power Automate
Unanswered

Open last modified file from Downloads

(0) ShareShare
ReportReport
Posted on by 802

Hi, 

 

I have a flow whereby I am saving an .xlsx file from an external portal to Downloads folder.

 

I am using Get files in folder which match .xlsx and sorting them in Descending order based on Last Modified in order to ensure that the file just downloaded appears at the top; and this saves into a variable called Files.

 

How can I now open the Last Modified file (which is an excel xlsx) from this action in PAD?

 

Thanks

K.

I have the same question (0)
  • VJR Profile Picture
    7,635 on at

    Hi @Kosenurm 

    The %Files[0]% will contain the last modified file.

    Just use this in the Launch Excel action.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks Multi Super User, your comment helped my flow

    1. I set up a variable with my file path - C:\Users\JohnDoe\Downloads. It created variable called "%ExcelVar%"

    2. I then added an action called "Get File in Folder" and attached the variable "%ExcelVar%" to it and filtered the file with the following *yourfilename*, dont forget the *. Then i sorted it by creation time and descended it.
    3. I then set another Variable and attached the following in the value "%Files[0]%"

    4. I then launched excel and attached the variable of step 3 to it

    This worked for me

     

    Thanks again

  • PADChecker Profile Picture
    5 on at

    Hello everyone & @Anonymous,

    I followed your exact steps but I keep getting the same error (excel does not launch with error: Failed to open Excel document %Files[0]%, file related error). See attached a screenshot of my flow: 

    PADChecker_1-1707141121712.png

     

    I tried without the %, changed the "*xls" with the name of the file but nothing. The file is indeed xls and not xlsx, that's why I am placing it like this.

     

    Do you know what I'm doing wrong?

     

    Thank you and best regards

     

  • Steve48 Profile Picture
    431 on at

    Hi @PADChecker 

    Line 14 doesn’t look correct. Delete the ‘=‘.

    if this helps, please mark as solution.

  • Steve48 Profile Picture
    431 on at

    Also line 15

  • eetuRobo Profile Picture
    4,572 Super User 2026 Season 1 on at

    You have Power Fx enabled and that has different syntax. I don't think Power Fx uses %% for variables anymore. Try taking them off.
    I suggest you create new flow without the Power Fx enabled:

    eetuRobo_0-1707141632975.png

     

  • PADChecker Profile Picture
    5 on at

    Thank you! @eetuRobo That was the issue!

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 233

#2
David_MA Profile Picture

David_MA 217 Super User 2026 Season 1

#3
Valantis Profile Picture

Valantis 190

Last 30 days Overall leaderboard