web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

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

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard