web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Create an array for ea...
Power Automate
Unanswered

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?

Categories:
I have the same question (0)
  • Verified answer
    Ellis Karim Profile Picture
    11,681 Super User 2025 Season 2 on at

    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.

  • Sakura Profile Picture
    151 on at

    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.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard