Remove Columns From A Collection
Remove Columns From A Collection Input collection: myTeams43 Team Person1 Person2 Person3 Team A Jen Phillips Leonard Petersen Murray Cole Team B Percy Walte...
- 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-columns-from-a-collection/. Author: Matthew Devaney.
Remove Columns From A Collection Input collection: myTeams43 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: mySolution43a (remove Person3 column) Team Person1 Person2 Team A Jen Phillips Leonard Petersen Team B Percy Walters Adam Davidson Team C Sarah Davy Melissa Stevens Solution code: //Create a collection
ClearCollect(myTeams43, { 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 a column code
ClearCollect(mySolution43a, DropColumns(myTeams43, "Person3" )); Code language: JavaScript ( javascript )
Output collection: mySolution43b (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(myTeams43, { 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 multiple columns code
ClearCollect(mySolution43b, DropColumns(myTeams43, "Person2" , "Person3" )); Code language: JavaScript ( javascript )
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.
Keep learning Microsoft 365
Explore more practical guides for SharePoint, Power Platform, Copilot Studio, migration, automation, governance, and security.
Continue learning
Related tutorials
Related questions
Related comparisons
Next action