unstuck
unstuck

Reputation: 646

How to add rows to an Excel table inside a loop after the columns are mapped?

How to add rows to an Excel table inside a loop after the columns are mapped? enter image description here

I tried the "Add rows to an Excel table" step, but I can't grab the values from Column1 and Column2 on the "Select" step above.

This should be easy, I guess, but I can't make it.

Thank you,

Upvotes: 0

Views: 5248

Answers (1)

Your "Select" actions looks like it might be missing something, seems like it will add the whole item to "Column1" and duplicate that for "Column2". If your value is an array but it is not being recognized as so, you can use the "Parse JSON" action, or the json() expression you should be able to select the keys that you want to use for each column.

I might need more details to see the exact issue with your flow, but in the meantime try this:

Parse JSON action

Here the "Initialize variable" will be your blob storage result.

array input

Array setup

  • In the Parse JSON, add you blob storage value
  • In the "Select" action use the body output of the "Parse JSON" action
  • You should be able to select the specific values you want in your columns

json() expression

The parameter will be your blob storage. In my example is my string variable sown in the image.

json expression

Since the "Select" action returns an array as a result, the next step you should use is the "Apply to each" action

Apply to each

The new values mapped in the "Select" action should be available to be used here, if for any reason they are not (it is common for power automate to have issues like this) you can use an expression to get the value

items('Apply_to_each')?['columnName'] 

Note that the "Apply_to_each" inside "items" will be different if you rename this action.

Then, you'll have your Excel file with all the rows added to the table you selected.

excel result

Upvotes: 2

Related Questions