You are currently viewing How Power Automate create excel table dynamically?

How Power Automate create excel table dynamically?

Microsoft Power Automate offers a powerful solution to automate processes and workflows, including the dynamic creation of Excel tables. In this article, we’ll explore how Power Automate create excel table dynamically and we will learn the following:

  • Create empty excel file using power automate
  • Create excel table in power automate
  • Power Automate dynamic excel table
  • Power Automate create table dynamic range
  • Power Automate add row to excel table dynamically
  • Power Automate create excel table from Json

How to create table in excel using power automate

Scenario: in this post we will learn how to create excel file with dynamic table from Json code that we get from PowerApps canvas app.

power automate create excel table dynamically

Step1: add Parse JSON action

Add Parse JSON action to get the data from your PowerApps data, you can follow this post to achieve this step correctly.

t0 | Power Platform Geeks

Step2: Create empty excel file using power automate

In this flow we created an empty excel file in OneDrive for business to use as a template of our new excel file that we will generate with our table of data.

So to Create a blank excel file do the following

  • Get the content of the empty template file to create new empty file to use inside our flow
Create a blank excel file
  • Add Create file Action to create the new empty file and in the File Content property add the content of the empty file “Template file” from Get file content action as shown below, now we create an empty excel file in the root to add our data.
create excel table dynamically in Power Automate

Step3:create excel table dynamically in Power Automate

No we will create an excel table inside our empty file using the Create table action

  • File property choose to add dynamic content and put the Name property of the Create file action.
  • Table Range: An Excel table range refers to a collection of data organized in rows and columns within an Excel worksheet that has been formatted as a table. The first cell in the table begin with A1 and ends with the range of your cells in the table.
    for example if you will create 4 columns in the table so it will begin with A1 and end with D1
    Note this is for empty table that not contain data the ends range will be the last cell of the last row if your file contain data. In this flow I only use an empty one column table so the format will be as the following
for 1 column $A$1:$A$1
for 4 column $A$1:$D$1
for 10 column $A$1:$J$1
and so on
  • Table name: Type a name for your table
  • Columns names: Put the title of the columns that you want to appear in your excel table
tt | Power Platform Geeks

Now power automate create excel table dynamically for you. Next we will need to add data to this table dynamically

Step4: Power Automate add row to excel table dynamically

Now we will add a compose action to create the row that we can add to the excel table , because at this time there is now table created yet and the column properties will not appear in the add row action so first we will need to prepare the row that we will add to the excel table using the compose action and the code will be as the following:

“Column name that you created in your Excel table”: “your dynamic data for that column from compose”

and you can use comma to add more columns to your table

{
  "Column1": "your dynamic data from JSON action",
"Column2": "your dynamic data from JSON action",
.
.
.
}

This will dynamically add the Apply to each action that will looping through the data that will be added to the excel file

t4 | Power Platform Geeks

Next we will add the Add a row into table action to add the data to the excel file

  • File: the Name Prperty of the Create file action
  • Table: choose to add custom value and type the Table name that you created before in the Create Table action as till this moment the excel not created the table or the file yet to retrieve for you so type the Same name as a custom value.
  • Row: add the row that we prepare in the compose action “the Output property of the compose action”.

Power Automate add row to excel table dynamically

Now your flow is ready and it will create a Blanck excel file , then add table to the file then add the data to this file dynamically

conclusion

In conclusion, Power Automate is a robust automation tool that allows users to create Excel tables dynamically, streamlining data processing and enhancing workflow efficiency. By integrating Power Automate with Excel, users can automate the process of generating tables from various data sources.

So its so easy to

  • Create empty excel file using power automate
  • Power Automate dynamic excel table
  • Power Automate create table dynamic range
  • Power Automate add row to excel table dynamically
  • Power Automate create excel table from Json
See Also
Join us

Heba Kamal

Microsoft MVP, MCT, Technical Speaker, Blogger, and Microsoft 365 and Power Platform Consultant.