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 / How to create table dy...
Power Automate
Answered

How to create table dynamically for all worksheets

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi, I want to create table dynamically in multiple worksheets. The excel file could have one or multiple worksheets. The number of records are different but the column headers are the same. I know how to create table dynamically from watching the tutorials in Youtube, it works but it only applies to the first or active worksheet in the excel file instead of all worksheets. I even tried using "Get Worksheet" and "Apply to each" actions but it didn't work too. Can somebody help me please?

Categories:
I have the same question (0)
  • SanmeshG Profile Picture
    1,947 Moderator on at

    Hi @Anonymous ,

     

    I have done a test on my side , and it works fine for me. Please follow the steps from the screenshot.

     

    ExcelTableDynamically1.pngExcelTableDynamically2.png

     

    =OFFSET(@{items('Apply_to_each')?['name']}!A1,0,0,SUBTOTAL(103,@{items('Apply_to_each')?['name']}!$A:$A),7)

     

    Here the last digit 7 , indicates the number of columns(Headers) in your excel Sheet.

     

    Hope this helps.

     

    Please give this answer a thumbs up and accept this as a solution , if this solves your problem.

     

    Thanks,

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @SanmeshG , thanks for the guide.

     

    I'm not sure why but it still only creates table on one worksheet only. Here's the run details:

    Screenshot 2023-07-07 112543.png

  • Verified answer
    SanmeshG Profile Picture
    1,947 Moderator on at

    Hi @Anonymous ,

     

    I have tried giving the same name to the sheet as that of your sheets.

     

    And I run into the same issue , so it turns out that , the Name cannot contain spaces. So in the compose try to wrap the worksheet Name in single quotes and it works fine.

     

    WrapSheetNameinQuotes.png

    output2.png

    Please give this a thumbs up if this solves your issue and accept this as a solution.

     

    Thanks,

    Sanmesh

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    It works! Thank you so much @SanmeshG, you're a lifesaver!

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
David_MA Profile Picture

David_MA 250 Super User 2026 Season 1

#2
Expiscornovus Profile Picture

Expiscornovus 222 Most Valuable Professional

#3
Haque Profile Picture

Haque 174

Last 30 days Overall leaderboard