cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BeckyC
Frequent Visitor

Add multiple rows to a table in excel

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-litu-msft
Community Support
Community Support

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.

View solution in original post

4 REPLIES 4
v-litu-msft
Community Support
Community Support

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
Frequent Visitor

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
Frequent Visitor

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]}
}

]

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"
        }
    }
}
 
 

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (1,391)