cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jan_U
Regular Visitor

How to append excel columns to an array as separate items?

Hi, I was hoping someone could suggest how I could achieve the outcome in the message title. It seems like it should be achievable, but I just can't work out how to get power automate to loop through all the columns!

 

I've got most of the logic of the flow down, but I dont know how to make step 3 work:

  1. The data source is an Excel file (in a Sharepoint doc library) with 50 columns and 1,000 rows.
  2. The flow searches for a specific row using an ODATA filter on the 'List rows present in a table' action. Each row has a unique ID in column 1, so we know we're only going to get 1 result or 0 results when we filter.
  3. The flow then adds the value in each of the other 49 columns into an array as separate item (presumably using an 'Apply to each' loop and the 'append to array' action).

 

As you can see, it's the looping through all the columns in step 3 that I'm missing! Any ideas?

 

The only solution I can think of is to have 50 'Append to array' actions and set each one to a different dynamic value provided by the 'List rows' action, but this is very clumsy and means we'd need to change the flow if we ever add or remove columns to the excel file (which we will every so often).

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

There is no way to do an Apply to each based on a column.  Apply to each only works on things that are already an Array.  So there really is no solution other than one Append to array for each specific column.  You'll still have an apply to each loop because although you are only retrieving one row it will still be a single row in an array.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

2 REPLIES 2
Pstork1
Dual Super User III
Dual Super User III

There is no way to do an Apply to each based on a column.  Apply to each only works on things that are already an Array.  So there really is no solution other than one Append to array for each specific column.  You'll still have an apply to each loop because although you are only retrieving one row it will still be a single row in an array.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Jan_U
Regular Visitor

That's a petty. At least there's a manual work around I guess! Thanks for your help!

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,165)