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 / Trying to merge multip...
Power Automate
Answered

Trying to merge multiple spreadsheets from a SharePoint Folder to one Master Spreadsheet

(1) ShareShare
ReportReport
Posted on by 48
Hi PowerAutomate Experts, I'm trying to get a solution where if I have multiple spreadsheets in a SharePoint Folder, and I want to get all the data from multiple spreadsheets and move it to a / one Master Spreadsheet which will also stay in the SharePoint.
 
I tried using 'List of rows present in a table' action but it's only pointing toward one spreadsheet and one table, The action 'add a row into a table' 
So here, I'm trying to get these two files but it's taking only one, tried For Each loop also, it didn't help either.
 
I'm using POWERAUTOMATE ONLINE .
 
Can somebody be able to help? I would appreciate that.
 
 
 
 
Best regards,
Sayan Kayal
Financial Systems Analyst
Central Michigan University, USA
I have the same question (0)
  • Verified answer
    Sunil Kumar Pashikanti Profile Picture
    1,077 Moderator on at
     
    You cannot use “List rows present in a table” with a file picker because it only allows one file. To merge multiple spreadsheets, you must use the file Identifier dynamically inside a loop.
     
    High‑level flow:
    1)List files in folder (get all .xlsx in the source folder)
    2)For each file
         2.1) Get tables (returns the Excel tables in that file)
         2.2) For each table
         → List rows present in a table (dynamic file Identifier + target Table Id)
         → Apply to each row → Add a row into a table (master workbook)
     
    This works because Excel actions accept a File Identifier when placed inside a loop; you don’t use the static file picker. Microsoft notes that the Excel connectors require a file identifier for dynamic scenarios and that you should resolve it from the file you’re looping over.
     
    Detailed Steps:
    1)List files in folder (SharePoint)
         Site Address: Your site
         Library: Documents (or your library)
         Folder: /Your/Subfolder
         (Optional) Add a Filter array after this to keep only .xlsx and skip ~$ temp files.
    2)Apply to each → value (from List files in folder)
    Inside this loop:
    2.1 Get tables (Excel Online (Business))
         Location: OneDrive for Business or SharePoint Sites (where your files live)
         Document Library: same as above
         File: Identifier → use the Identifier from the current file (Dynamic content: Identifier)
              Don’t use the picker; pick Identifier from the “List files in folder” item.
    2.2 Apply to each → value (from Get tables)
    Inside this inner loop:
    2.2.1 List rows present in a table (Excel Online (Business))
         Location / Document Library: same as above
         File: Identifier (again, from the outer “List files in folder” loop item)
         Table: Id (from the Get tables action)
         Pagination: On if you expect >256 rows; set threshold high enough (e.g., 100000). Microsoft documents the default 256‑row cap and other limits (500 columns, simple filters only). [help.lexia...arning.com]
    2.2.2 Apply to each → value (from List rows present in a table)
    Add a row into a table (Excel Online (Business))
         Location / Library: where your MasterFile.xlsx lives
         File: pick the master workbook (static—this one can be the picker)
         Table: MasterTableName
         Map each target column to the current item’s columns (from the row dynamic content).

    Why “Get tables”? Some files may have more than one table—or different table names. “Get tables” returns the table Id list per file so you don’t hardcode. That Id is the only stable way to feed List rows present in a table dynamically.
     
    ✅ If this answer helped resolve your issue, please mark it as Accepted so it can help others with the same problem.
    👍 Feel free to Like the post if you found it useful.
  • Suggested answer
    Haque Profile Picture
    888 on at
    Hi @kayal1s,  
     
    Could you please mention the data size (on average, how many sheets you want to merge into a merged file and how many rows can be there in total in the merged file per flow call)? I am asking this because the growing size of data will cost you something in the flow that would be tough for PA to handle. As @ suggested, you see there are multiple "Apply to each" loops that might raise some flags. 
     
     
    I suggest, if you have options to select, please go for Power Query or Office Script
     
     

    I am sure some clues I tried to give. If these clues help to resolve the issue brought you by here, please don't forget to check the box Does this answer your question? At the same time, I am pretty sure you have liked the response!
  • Sayan Kayal Profile Picture
    48 on at
    @Sunil Kumar Pashikanti I did try to follow your steps but for some reason, it's giving me errors, can you please help me out if possible?
    I'm attaching the actions in the attachment.
     
     
     
    Thanks,
    Sayan
  • Sunil Kumar Pashikanti Profile Picture
    1,077 Moderator on at
     
    Can you please share the exact error message you’re receiving in your Power Automate run?
    A screenshot of the red error box or the error text under ‘Show raw outputs’ would help us identify the exact step failing and fix it accurately.
     
    Meanwhile you can follow the below blogpost for the same example: 
  • Sayan Kayal Profile Picture
    48 on at
    Good morning @Sunil Kumar Pashikanti, your GitHub page is really helpful to understand, but for some reason, when I try to upload the package, it doesn't like me in PowerAutomate-
    This is the file I'm importing 
     
    PowerAutomate import error message-
     
    I tried multiple times but received the same exact error message.
     
     
    Your complete flow looks great-
    Can you please branch out these actions? Like I'm not sure what value to put in "Compose Excel File Path" or "Filter array source files".
     
    I appreciate all your help on this, this is a great solution you provided but I needed a few more detailed instructions if possible by you, thank you so much for all your help!
     
     
     
    Best regards,
    Sayan
  • Verified answer
    Sunil Kumar Pashikanti Profile Picture
    1,077 Moderator on at
     
    Thanks for letting me know about the zip package file issue, I didn't get any error from my side, probably I will try in different tenant.

    I have uploaded all the screen shots at below location, unable to add here as they are huge and more images.
    Merge Multiple Excel Files - Workflow Screenshots
     
     
  • Sayan Kayal Profile Picture
    48 on at
    Good morning @Sunil Kumar Pashikanti, your solution was absolutely stunning- what a great work you did, I really appreciate all your help- especially the detailed screenshots. It really helped me and our organization by saving a lot of time.
     
    Happy Friday!
     
     
    Best regards,
    Sayan
  • Sunil Kumar Pashikanti Profile Picture
    1,077 Moderator on at
     
    I really appreciate your kind words.!
    I’m really glad the solution helped you and your team.
     
    Happy to support anytime.

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 333

#2
David_MA Profile Picture

David_MA 245 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 202 Most Valuable Professional

Last 30 days Overall leaderboard