Rename The Columns In A Collection
Rename The Columns In A Collection Input collection: myInventory34 ID Name Quantity 1001 Desktop PC 10 1002 Monitor 23 1003 Laptop 16 Output collection: myIn...
- 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/rename-the-columns-in-a-collection/. Author: Matthew Devaney.
Rename The Columns In A Collection Input collection: myInventory34 ID Name Quantity 1001 Desktop PC 10 1002 Monitor 23 1003 Laptop 16
Output collection: myInventory34 a (rename ‘Quantity’ column) ID Name OnHand 1001 Desktop PC 10 1002 Monitor 23 1003 Laptop 16 Solution code: //Create a collection
ClearCollect(myInventory34, { ID : 1001 , Name : "Desktop PC" , Quantity : 10 }, { ID : 1002 , Name : "Monitor" , Quantity : 23 }, { ID : 1003 , Name : "Laptop" , Quantity : 16 } ); //Change the column name code
ClearCollect( mySolution34a, RenameColumns(myInventory34, "Quantity" , "OnHand" ) ); Code language: JavaScript ( javascript )
Output collection: myInventory34 b (rename ‘Name’ & ‘Quantity’ columns) ID Product OnHand 1001 Desktop PC 10 1002 Monitor 23 1003 Laptop 16 Solution code: //Create a collection
ClearCollect(myInventory34, { ID : 1001 , Name : "Desktop PC" , Quantity : 10 }, { ID : 1002 , Name : "Monitor" , Quantity : 23 }, { ID : 1003 , Name : "Laptop" , Quantity : 16 } ); //Change multiple column names code
ClearCollect( mySolution34b, RenameColumns(myInventory34, "Name" , "Product" , "Quantity" , "OnHand" ) ); 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