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 / List Files in Folder i...
Power Automate
Unanswered

List Files in Folder in Excel

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

I'm trying to make a flow that will look at a folder and list all on those files into an Excel sheet. My flow does this but I would like it to show the file name not the file path. I am trying a 'For Each' but am receiving an error. How can I make this work?

kirabray_0-1671133871500.png

 

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

    Hi @Anonymous 

    Hope you are using the CurrentItem in the Get file path part.

    If still not working please share a screenshot of this action.

    VJR_0-1671157626186.png

     

    From the list of toggle buttons shown above enable/disable based on your requirements.

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    If you really want to use for each, then open excel and just write %CurrentItem.Name% or %CurrentItem.NameWithoutExtension% directly to the cells. For instance, if you are putting them in column A…

    set variable index=2 (assuming starting row 2)

    launch excel

    for each

        Write to excel in column A and row %index%
        set variable %index% to %index+1%
    end for each

     

    however, there is a much faster way to do this. 

    Run CMD for the folder you used in Get Files

    write to cmd:  dir /b | clip ‘this copies all filenames in the current directory to the clipboard. 
    Launch excel

    activate the proper cell

    paste from clipboard

    ’should be done

        

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!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 557

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 264 Super User 2026 Season 1

Last 30 days Overall leaderboard