Skip to content

Power Apps

Remove All Columns From A Collection Except

Remove All Columns From A Collection Except Input collection: myTeams44 Team Person1 Person2 Person3 Team A Jen Phillips Leonard Petersen Murray Cole Team B ...

Matthew Devaney
Published
Reading time
1 min read

Before you start

Is this guide for you?

Best entry point
Power Apps
Time investment
1 min read

Imported reference from Matthew Devaney's blog for learning purposes. Original: https://www.matthewdevaney.com/powerapps-collections-cookbook/remove-all-columns-from-a-collection-except/. Author: Matthew Devaney.

Remove All Columns From A Collection Except Input collection: myTeams44 Team Person1 Person2 Person3 Team A Jen Phillips Leonard Petersen Murray Cole Team B Percy Walters Adam Davidson Alice Lemon Team C Sarah Davy Melissa Stevens Bernice Friesen

Output collection: mySolution44a (show only ‘Team’ column) Team Team A Team B Team C Solution code: //Create a collection

ClearCollect(myTeams44, { Team : "Team A" , Person1 : "Jen Phillips" , Person2 : "Leonard Petersen" , Person3 : "Murray Cole" }, { Team : "Team B" , Person1 : "Percy Walters" , Person2 : "Adam Davidson" , Person3 : "Alice Lemon" }, { Team : "Team C" , Person1 : "Sarah Davy" , Person2 : "Melissa Stevens" , Person3 : "Bernice Friesen" } );

//Remove all columns except a single column code

ClearCollect(mySolution44a, ShowColumns(myTeams44, "Team" )); Code language: JavaScript ( javascript )

Output collection: mySolution44b (show only ‘Team’ & ‘Person1’ column) Team Person1 Team A Jen Phillips Team B Percy Walters Team C Sarah Davy Solution code: //Create a collection

ClearCollect(myTeams44, { Team : "Team A" , Person1 : "Jen Phillips" , Person2 : "Leonard Petersen" , Person3 : "Murray Cole" }, { Team : "Team B" , Person1 : "Percy Walters" , Person2 : "Adam Davidson" , Person3 : "Alice Lemon" }, { Team : "Team C" , Person1 : "Sarah Davy" , Person2 : "Melissa Stevens" , Person3 : "Bernice Friesen" } );

//Remove all columns except multiple columns code

ClearCollect(mySolution44b, ShowColumns(myTeams44, "Team" , "Person1" )); Code language: JavaScript ( javascript )

Share this

Tagged

Collections · Power Apps

Have a Microsoft 365 topic idea?

Share article suggestions, community session ideas, corrections, or real-world scenarios for future nextM365 learning notes.

Suggest a topic

Keep learning Microsoft 365

Explore more practical guides for SharePoint, Power Platform, Copilot Studio, migration, automation, governance, and security.

Continue learning

Next action

What to do next

Browse all tutorials →