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 / Reading multiple files...
Power Automate
Answered

Reading multiple files, folders and subfolders

(0) ShareShare
ReportReport
Posted on by 8

Hello,

 

I'm working on a desktop flow with the general intent of sending emails with attachments.

 

However, I need to do this on a larger scale involving multiple folders, subfolders and excel worksheets.

 

I figured I could try to read filepaths from a separate excel, but that didn't seem to work.

 

Is there an alternative?

 

Thanks in advance.

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

    Hi @Owlie__ 

     

    You could still read the filepath from a separate Excel as you mentioned.

    Can you share what didn't work and what issues you faced.

  • Owlie__ Profile Picture
    8 on at

    I read the folders and added the filepaths of specific subfolders and files to a separate excel, then tried reading the excel. From there, I attempted to launch different excels from that spreadsheet using a loop.

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Are you able to share an example of your spreadsheet.  For instance, if you had something like this, it would be easily doable:

    MichaelAnnis_0-1635171935133.png

     

    Under this example, we could set up a for each, and it will run through each row adding the attachments to the email until the email address is different, then it would send that email off with the attachments before continuing to the next row.



  • Pavel_NaNoi Profile Picture
    1,074 on at

    Definitely need more detail on the situation you're facing preferably with some screenshots to help with the explanation, otherwise can't you just use a "Get files" action + a "For each" loop to email these files?

  • Owlie__ Profile Picture
    8 on at

    The situation is as such:

     

    My folder contains a group of folders for different categories, each containing a subfolder of PDFs and an Excel which is a list of emails I need to send these PDFs to. Instead of creating a flow for each folder, I wanted to try to make a single flow that can loop through all the folders.

     

    I have made a separate Excel to compile the file paths of each folder to have the flow launch the few excel listings and send the emails from there.

    CategoryNameFolderSubFolderExcelFile
    Category AC:\Folder1C:\SubFolder1List1.xlsx
    Category BC:\Folder2C:\SubFolder2List2.xlsx

     

    However, it seems that the flow is not able to read the file paths from Excel because I kept getting the error "Argument 'Folder/Path' must be 'Folder/File'".

     

    I'm not sure if it's a good enough explanation of my current situation, but I hope it clarifies.

  • Verified answer
    VJR Profile Picture
    7,635 on at

    Hi @Owlie__ ,

     

    .

    CategoryNameFolderSubFolderExcelFile
    Category AC:\Folder1C:\SubFolder1List1.xlsx
    Category BC:\Folder2C:\SubFolder2List2.xlsx

     

    In your PAD flow are you combining the path as follows

    Folder + Subfolder + Excel File

     

    If so this would be incorrect because then it will result as below

    C:\Folder1\C:\Subfolder1\List.xlsx

     

    If you can see the path is coming out to be incorrectly

     

    It should be in the format

    C:\Folder1\SubFolder1\List.xlsx

     

    Arrange your Subfolder column to display only as Subfolder1.

     

    While looping through the folders, at the beginning you can simply use a "Display message" action and see what path it is picking.

  • Owlie__ Profile Picture
    8 on at

    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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 245

#2
David_MA Profile Picture

David_MA 216 Super User 2026 Season 1

#3
Valantis Profile Picture

Valantis 212

Last 30 days Overall leaderboard