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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Suggested Answer

Pivot collection

(1) ShareShare
ReportReport
Posted on by 154
I ingest a Sharepoint list into a Powerapps collection.  It has a single column, so the collection is like this.
 
Value
-------
Company1
Company2
Company3
 
I want to turn this collection, so that Company1, Company2 and Company3 are column headings in a new collection then add values.  New collection should be like this.
 
Company1   Company2  Company3
4                      5                7
 
What's the best way to do this?
Categories:
I have the same question (0)
  • Suggested answer
    Riyaz_riz11 Profile Picture
    4,171 Super User 2026 Season 1 on at
    Hi,
     
    Note: Power Apps does not support creating column names dynamically at runtime in a collection.
     
    Instead, use a key value structure:
     
    ClearCollect(
        colResults,
        AddColumns(
            colCompanies,
            Score,
            Switch(
                Value,
                "Company1", 4,
                "Company2", 5,
                "Company3", 7
            )
        )
    )
     
    Result:
    Value    Score
    Company1    4
    Company2    5
    Company3    7

    Keep the data in a normalized format:
    Company     Score
    -------     -----
    Company1      4
    Company2      5
    Company3      7
    This works much better with galleries, forms, filtering, sorting, and patching than dynamically generated column names.
     
    If I have answered your question, please mark it as the preferred solution ✅ . If you like my response, please give it a Thumbs Up 👍.
    Regards,
    Riyaz
  • Suggested answer
    11manish Profile Picture
    2,647 on at
    Power Apps does not natively support creating collection column names dynamically from data values.
     
    The best practice is usually to keep the data in rows (Company, Value) rather than converting company names into columns.
     
    If you need a true pivot table with dynamic column names, Power Apps is not the ideal place to do the transformation. Consider using:
    • Power Automate
    • SQL
    • Excel
    • Power BI
    • Dataverse views
    to pivot the data before it reaches the app.
  • Suggested answer
    Valantis Profile Picture
    6,025 on at
     
    Power Apps can't create column names dynamically from data values that's a confirmed platform limitation. Riyaz and 11manish are right.

    If you need the pivoted display (Company1, Company2, Company3 as headers in a table), the cleanest approach is to keep the data in the key-value format (Company, Score) and use a horizontal gallery in Power Apps that renders each company as a column header dynamically. This gives the visual appearance of a pivot table without needing dynamic schema.

    If the data genuinely needs to arrive pre-pivoted, do the pivot in Power Automate before loading it into the collection, or use a SharePoint view with calculated columns. Either way, do the transformation outside Power Apps.
     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

    💼 LinkedIn

    ▶️ YouTube

  • AH-02011058-0 Profile Picture
    154 on at
    The list of companies can vary, so I don't want to hardcode.  It looks like Power Automate with a powerapps trigger is the way forward.  Has anyone done something like this?
     
    I looked at this, but couldn't get the addProperty to work on my array.
     
    I also had issues when Power automate wanted an array not an object.  Does anyone have a Flow I can go through step by step?

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 385

#2
Vish WR Profile Picture

Vish WR 367

#3
timl Profile Picture

timl 340 Super User 2026 Season 1

Last 30 days Overall leaderboard