cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jan_U
Frequent 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
Dual Super User

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.

Join me at 365EduCon in Chicago on Sept. 26-30 where I'll be presenting on the Power Platform!

View solution in original post

2 REPLIES 2
Pstork1
Dual Super User
Dual Super User

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.

Join me at 365EduCon in Chicago on Sept. 26-30 where I'll be presenting on the Power Platform!
Jan_U
Frequent Visitor

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

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

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.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (3,549)