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 / Variable name of file ...
Power Automate
Answered

Variable name of file for "Attach to running Excel"

(0) ShareShare
ReportReport
Posted on by

I have a flow that runs a report from a data website, then exports the excel file which then opens on my machine. The filename will always begin with "Data - " but the remainder of the file name will different every time.

I've searched and can't find a way within the flow to reference that exported file when doing "Attach to running Excel", as there doesn't seem to be 'contains' available... just the fixed filename...

I need to be able to then run a macro on that file to finish the flow...

Any help is greatly appreciated!

  • Srini007 Profile Picture
    3,490 Super User 2026 Season 1 on at

    Hi @Murphys110 

     

    Once you created the file, then you can use "Get Files in Folder" action and in that go to advance and there Sortby select the Last Modified / Creation Time

     

    Another method is when you saving a file you can set a variable according to your Filenaming convention and pass the same to further actions

     

    If you find this reply helpful, please consider giving it a LIKE AND

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION

     

    Thanks,

    Srini

  • Murphys110 Profile Picture
    on at

    Thank you Srini, and I should have been more clear in my original post, but there is no mechanism for me to change the file name upon export. Also, the file will be opened already as part of the export process. 

    Looking for a way to reference that file even though the name will not be constant...

  • Verified answer
    Srini007 Profile Picture
    3,490 Super User 2026 Season 1 on at

    Hi @Murphys110 

     

    Ok, so when ever the file is ready for export it is not giving you any option to save instead it is opening directly in you machines excel

     

    Check where the excel is stored, I believe it is storing in the downloads/temp folder?

    If so then you can change your browser settings to ask when the download is available, so that once it is ready to download then it will show an popup to save the file instead opening automatically

     

    If you are using chrome go to settings search for ask and check this option is enabled

     

    Srini84_0-1697482847068.png

     

    From now it will not download automatically but will show a pop as save as, once you click that then it will prompt you to save the file and you need to provide the full path of the file with filename

     

    If this is not case apolozie, please add more details how it is automatically opening

     

    If you find this reply helpful, please consider giving it a LIKE AND

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION

     

    Thanks,

    Srini

  • Murphys110 Profile Picture
    on at

    Ah... that will work, since I will be saving over any previous version, I am able to use the same file name. Works well, thank you!

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
Mohsin Ali Profile Picture

Mohsin Ali 355

#2
11manish Profile Picture

11manish 336 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard