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 Apps / List column manipulati...
Power Apps
Unanswered

List column manipulation (columns to rows) into collection

(0) ShareShare
ReportReport
Posted on by

Good morning, all.

 

I'm looking to create a collection from a SharePoint list, where the list columns equate to rows in the collection. Here is a simple example:

 

liscolumnmanipulation.png

 

I can easily create a collection that mirrors the SharePoint list (single row with multiple columns), but I haven't been able to figure out how to flip the data around so to speak to get the desired result show above.

 

As always, thanks in advance for ideas and assistance!

Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,923 on at

    Do you expect the column names to be part of the output or converted to record as well?

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

    Consider Checking My Youtube Channel

     

  • Community Power Platform Member Profile Picture
    on at

    Yes, that is the goal.

     

    I've been playing around with that piece a bit and am getting close with something like this:

    Collect(colUserTrainingTEST,AddColumns('DU Module List'.TrackingName,"TrackingName2",TrackingName))
  • rubin_boer Profile Picture
    4,841 Super User 2024 Season 1 on at

    hey hey @Anonymous , this is one of those where you want to say "fix it at the data source" :).

     

    You could do the following (not the cleanest tho but to give an idea).

     

    Collect Bim and SharePoint in two collections and then add these two for e.g.

    ClearCollect(colBim,ForAll(yourDatasource,{tracking:"BIM", value:BIM}));
    ClearCollect(colSharePoint,ForAll(yourDatasource,{tracking:"SharePoint", value:SharePoint}));
    ClearCollect(colTransposed,colBim,colSharePoint)

    What you will get are these things

    Bim collection

    rubin_boer_0-1632232764387.png

     

    SharePoint collection

     

    rubin_boer_1-1632232783647.png

     

    Combined

    rubin_boer_2-1632232855941.png

     

    Hope this gives some direction.

     

     

     

  • Community Power Platform Member Profile Picture
    on at

    @rubin_boer , thanks. Yeah I know changing the source is probably the best option, but this is an existing list with about 65-70 columns tracking attendance/completion of training classes for all employees, so it's what I have to work with atm.

     

    That said, your solution appears to work but may not scale well (or easily at least) given the number of columns mentioned above but the end result is definitely what I need.

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard