Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Create an array for each Excel table column

(0) ShareShare
ReportReport
Posted on by 151

Hi all

I need to loop columns in a table of an Excel Online file stored on Sharepoint.
Each column needs to be saved to an array. Then that array needs to be appended to an array of arrays.

For example

FruitVegetablesAnimals
AppleLettuceCow
PearCarrotDog
BananaBroccoliCat


Result should be:

 

 

[
 [Apple, Pear, Banana],
 [Lettuce, Carrot, Broccoli], 
 [Cow, Dog, Cat]
]

 

 



It seems to be impossible unless I initialize an array variable for each column or do it in Office Script. I want to avoid the latter due to the Run Script daily call limitations. Is there a more dynamic solution within Power Automate someone has come up with?

  • Sakura Profile Picture
    151 on at
    Re: Create an array for each Excel table column

    Dear @ekarim2020  thank you so much for this thorough walkthrough! This works nicely. It is still an issue when the number of columns can change per file, but it's already a good help.

  • Verified answer
    Ellis Karim Profile Picture
    11,120 Super User 2025 Season 1 on at
    Re: Create an array for each Excel table column

    Here is one approach to the problem. Starting with the following Excel file:

    ekarim2020_2-1632439881513.png

    This is the flow which reads the Excel file:

    2021-09-24_00-20-22.jpg

    ekarim2020_1-1632439762044.png

    Note the commas as used in the Compose Array action:

    ekarim2020_5-1632441585093.png

    Then finally looping through the array and reading the items:

    2021-09-24_08-34-09.jpg

    ekarim2020_0-1632469989160.png

     

    Ellis


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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1