Get Collection Column Names
Get Collection Column Names Input collection: myTrucks5 Year Make Model Mileage 2020 Ford F150 12343 2018 Chevy Silverado 170567 2020 Ford F150 98765 2017 Ni...
- 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/get-collection-column-names/. Author: Matthew Devaney.
Get Collection Column Names Input collection: myTrucks5 Year Make Model Mileage 2020 Ford F150 12343 2018 Chevy Silverado 170567 2020 Ford F150 98765 2017 Nissan Frontier 123975 2016 GM Yukon 98753 Output collection: mySolution5 Result Make Mileage Model Year Solution code: //Create a collection
ClearCollect(myTrucks5, { Year : 2020 , Make : "Ford" , Model : "F150" , Mileage : 12343 }, { Year : 2018 , Make : "Chevy" , Model : "Silverado" , Mileage : 170567 }, { Year : 2020 , Make : "Ford" , Model : "F150" , Mileage : 98765 }, { Year : 2017 , Make : "Nissan" , Model : "Frontier" , Mileage : 123975 }, { Year : 2016 , Make : "GM" , Model : "Yukon" , Mileage : 98753 } ); // Get column names
Set ( myJSON, Distinct( Ungroup( MatchAll(
JSON ( myTrucks2, JSONFormat.IgnoreBinaryData ), "([^" "]+?)" "s*:" ).SubMatches, "SubMatches" ), Value ) ) 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