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']}
}
Solved! Go to Solution.
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:
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.
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:
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.
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]
}
]
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:
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
At the monthly call, connect with other leaders and find out how community makes your experience even better.
User | Count |
---|---|
23 | |
23 | |
23 | |
22 | |
17 |
User | Count |
---|---|
55 | |
39 | |
37 | |
29 | |
26 |