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 / Get one worksheet from...
Power Automate
Suggested Answer

Get one worksheet from an excel file and save it to a new file

(1) ShareShare
ReportReport
Posted on by 14
I need to copy over one worksheet from a workbook and save it to a new file. I cannot figure out how to do this within my flow. I'd like to add this step before my "convert file to pdf" step so that my PDF only exportts that one worksheet.
 
I truly can't figure out how to copy a singular tab/worksheet from an excel file and create a new file with just the one worksheet.
 
thanks
Categories:
I have the same question (0)
  • Suggested answer
    Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at
    Hi,
     
    for trying this up, i think we need to have template file which would have some formatting simmilar to sheet which you are trying to copy. 
     
    Take this as an example
     
    This is worksheet we need to copy to new sheet.
     
    This is the template file created out of sheet which we are supposed to copy to.
     
     
     
    Now see the flow which copies that sheet data to new file.
     
    1. Use Get file content to get template file content
     
    2. use create file action to create new file with same format of template file.
     
    Here i have provided file name with expression - 
    concat(formatDateTime(utcNow(),'yyyyMMdd'),'.xlsx') - you can change it accordingly.
     
    Now place the file content in the input which is obtained from get file content's output.
     
    3. Now list all rows present in input file as shown below
     
    4. use get tables to get list of tables present in workbook created out of template file.
     
     
    5. use apply to each to loop through each row as shown below
     
    Inside the apply to each - follow these steps
     
    5.1 - use compose action to create json structure for column addition in template file sheet.
     
     
    5.2- use add row to table action to add the row as in compose action 
    Expression - 
    first(outputs('Get_tables')?['body/value'])?['id']
     
     
    Hope it helps !
    Thanks & Regards,
    Nived N 
    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs
     Found my answer helpful? Please consider marking it as the solution!
     Your appreciation keeps me motivated. Thank you!

     
  • sgeorg87 Profile Picture
    14 on at
     
    Unfortunately your solution won't work as the sheet i'd like to extract is not in table format. My current worksheet has two tabs. The second tab (SheetB) is the data (which is in table format). However, I have written an office script that puts the data on SheetA in a specific format.
     
    I need a way to copy/print SheetA only.
  • sgeorg87 Profile Picture
    14 on at
    Here is the flow currently:
     

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 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard