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 / Create a table in an E...
Power Automate
Unanswered

Create a table in an Excel workbook in a specific folder

(1) ShareShare
ReportReport
Posted on by 59

We have a folder where an Excel file is dropped in SPO about every two weeks. It has tons of columns and rows, but not in table format. 

I've looked at the Create table action in Power Automate, but it requires a specific file instead of just looking in a folder. Is there dynamic content or an expression that can be used to create the table in a newly created file in the folder without specifying a file name? 

Categories:
I have the same question (0)
  • ScottShearer Profile Picture
    25,270 Most Valuable Professional on at

    You probably want to take a look at using Office script to create the table.  The script can be executed from Power Automate when a new item is added to the folder.

     

  • bblande Profile Picture
    59 on at

    Yeah I should have mentioned that I'm in a DoD environment and scripts are a no-go around these parts, but thanks.

  • ScottShearer Profile Picture
    25,270 Most Valuable Professional on at

    @bblande 

    I am familiar with the DoD and these are a different type of script - you might want to try.....

    Another option is for you to rename the files via a Flow when they are uploaded.  This will allow you to specify a specific file in the Create table action.  Then, after the table is created, rename it again to what is was.  If you use this approach, you'll likely need to use a number of pauses or a loop as you will probably see file in use errors.

     

  • Verified answer
    grantjenkins Profile Picture
    11,063 Moderator on at

    Below is how I would likely build this.

     

    See full flow below. I'll go into each of the actions.

    grantjenkins_0-1700626592244.png

     

    I would use the trigger When a file is created (properties only) so each time you upload/create a new Excel file it will trigger the flow. In my trigger below it's looking for new files in my Documents library within the folder called Drop Excel Files - so any file created in that folder (including within subfolders) will work.

    grantjenkins_1-1700626983837.png

     

    In addition - I would also add a Trigger Condition to ensure the flow only runs if the file uploaded is an Excel file. To do this, go into Settings then add a Trigger Condition and use the following expression.

    @endsWith(triggerOutputs()?['body/{FilenameWithExtension}'], '.xlsx')

    grantjenkins_2-1700627044289.png

     

    grantjenkins_3-1700627070499.png

     

    For the Table - As long as your Excel file has the table content starting at cell A1 and the first row contains your headers, then this should dynamically select your range of data and use the existing column headers.

    =$A$1:INDEX($1:$1048576,COUNTA($A:$A),COUNTA(1:$1))

    grantjenkins_4-1700627207714.png

  • takolota1 Profile Picture
    4,974 Moderator on at
    You can also use this template Azure Function to pull data from any Excel sheet without the need for table formatting...
    https://community.powerplatform.com/galleries/gallery-posts/?postid=eea06380-8483-ef11-ac21-7c1e5201b42f

    Or if you need something without premium connectors, then you can use these Office Script templates…

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

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard