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 / Add multiple rows to a...
Power Automate
Unanswered

Add multiple rows to a table in excel

(0) ShareShare
ReportReport
Posted on by 28

Hi

Is there any way to add more than one row at at time to a table in excel?

 

Here is what I have - I'd like to have one row with customer name and then another line right under it with the customer number. If I can add more than one, what would I use as a separator?

 

Thanks

Becky

 

 

{
 "Label": "Customer Name",
 "Info": @{triggerOutputs()?['body/CustomerName']}
}

 

 

 

 

BeckyC_1-1605615619849.png

 

 

Categories:
I have the same question (0)
  • Verified answer
    v-litu-msft Profile Picture
    on at

    Hi @BeckyC,

     

    Add a row into a table action only support add one row into the table once run, not support add multiple rows at the same time.

    If you want to add multiple rows to the excel table, you could initialize an array variable to store data you want to add, then use Apply to each + add a row into a table action to do it, for example:Screenshot 2020-11-18 101805.jpg

     

    Screenshot 2020-11-18 101849.jpg

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Navansh Profile Picture
    27 on at

    Hi @v-litu-msft 

     

    I tried the solution above but i am getting error The variable 'Array' of type 'Array' cannot be initialized or updated with value of type 'String'. The variable 'Array' only supports values of types 'Array'.

     

     

     

    i initialised the variable Array with below value:

    [

    {
    "Product Name": "Delta",
    "Year-1": variables('ProductsArrayY1')[0],
    "Year-2": variables('ProductsArrayY2')[0],
    "Year-3": variables('ProductsArrayY3')[0],
    "Year-4": variables('ProductsArrayY4')[0],
    "Year-5": variables('ProductsArrayY5')[0]
    },
    {
    "Product Name": "Zeta",
    "Year-1": variables('ProductsArrayY1')[1],
    "Year-2": variables('ProductsArrayY2')[1],
    "Year-3": variables('ProductsArrayY3')[1],
    "Year-4": variables('ProductsArrayY4')[1],
    "Year-5": variables('ProductsArrayY5')[1]
    },
    {
    "Product Name": "Atos",
    "Year-1": variables('ProductsArrayY1')[2],
    "Year-2": variables('ProductsArrayY2')[2],
    "Year-3": variables('ProductsArrayY3')[2],
    "Year-4": variables('ProductsArrayY4')[2],
    "Year-5": variables('ProductsArrayY5')[2]
    }

    ]

    Capture.JPG

     

    Capture.JPG

  • Navansh Profile Picture
    27 on at

    Found the solution 

     

    [

    {
    "Product Name": "Delta",
    "Year-1": @{variables('ProductsArrayY1')[0]},
    "Year-2": @{variables('ProductsArrayY2')[0]},
    "Year-3": @{variables('ProductsArrayY3')[0]},
    "Year-4": @{variables('ProductsArrayY4')[0]},
    "Year-5": @{variables('ProductsArrayY5')[0]}
    }

    ]

  • MitchallC Profile Picture
    6 on at

    Having a wierd issue when trying to recreate this. It seems to be working fine and the input log all looks good but on the excel sheet I am only seeing empty rows being added. Could be relevant that the "apply to each" action is being called in a switch case.

     

    Array declaration:

    [
      {
        "Required Access Right""Advanced Find User"
      },
      {
        "Required Access Right""All Staff"
      },
      {
        "Required Access Right""Advanced Find User"
      },
      {
        "Required Access Right""All Staff"
      },
      {
        "Required Access Right""Advanced Find User"
      },
      {
        "Required Access Right""All Staff"
      }
    ]
     
    Input log from one of the row adding actions after test:
    {
        "host": {
            "connectionReferenceName""shared_excelonlinebusiness",
            "operationId""AddRowV2"
        },
        "parameters": {
            "source""sites/company_name_removed_for_anonimity",
            "drive""b!a1NxJql1KUuI3gPt_dNfS7eoonavXEJIohOx5JUncCDxMYfU-rB9RpdvgEvggm-p",
            "file""/Shared Documents/General/Temp/Mitch Cowell123 New Starter.xlsx",
            "table""{10D46297-E8F3-4192-B232-18502F3D5E3F}",
            "item": {
                "Required Access Right""All Staff"
            }
        }
    }
     
     
  • MasterRA Profile Picture
    66 on at

    This solution does not help at all because it is only feasible for a few records but for more than 1000 records it becomes unbearable and inefficient, the problem is that the user has to generate a report where there are almost always 1000 records (between more or less). and the unthinkable thing is that it takes almost more than half an hour processing record by record; It is not a solution that helps me and more because in almost all questions of this style they always suggest this "solution", why has no one thought of a real solution that only gives an example with 5 records?

  • Hakim_Bouc Profile Picture
    19 on at

    @BeckyC @v-litu-msft 

    I found that power automate allow users to add only one row to excel, so I'm trying something else but I keep getting this error, any assistance please ?

    Hakim_Bouc_0-1681395998152.png

     

  • Navansh Profile Picture
    27 on at

    Hi @Hakim_Bouc 

    The variable you have initialized is of type "Boolean", change it to type "Array" and the error will be resolved.

  • takolota1 Profile Picture
    4,974 Moderator on at

    @MasterRA 

     

    This newly updated Office Scripts solution can intake any JSON array with keys/fields matching a table’s column header and update & create rows in batches

    https://powerusers.microsoft.com/t5/Power-Automate-Cookbook/Excel-Batch-Create-Update-and-Upsert/td-p/1624706

  • TheFreeMan Profile Picture
    48 on at

    A little late to the party, but this solution may work for you: https://www.matthewdevaney.com/quickly-add-multiple-rows-to-excel-table-in-power-automate/

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

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard