Get The Middle Rows Of A Collection
Get The Middle Rows Of A Collection Input collection: myCars21 Year Make Model 2016 Toyota Corolla 2014 Honda Civic 2019 Toyota Camry 2018 Honda Civic 2018 H...
- 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-the-middle-rows-of-a-collection/. Author: Matthew Devaney.
Get The Middle Rows Of A Collection Input collection: myCars21 Year Make Model 2016 Toyota Corolla 2014 Honda Civic 2019 Toyota Camry 2018 Honda Civic 2018 Hyundai Elantra 2020 Honda Accord Output collection: mySolution21 a Year Make Model 2019 Toyota Camry Solution code: //Create a collection
ClearCollect(myCars21, { Year : 2016 , Make : "Toyota" , Model : "Corolla" }, { Year : 2014 , Make : "Honda" , Model : "Civic" }, { Year : 2019 , Make : "Toyota" , Model : "Camry" }, { Year : 2018 , Make : "Honda" , Model : "Civic" }, { Year : 2018 , Make : "Hyundai" , Model : "Elantra" }, { Year : 2020 , Make : "Honda" , Model : "Accord" } ); //Get middle row code
ClearCollect( mySolution21a, Last(FirstN(myCars21, 3 )) ); Code language: JavaScript ( javascript ) Output collection: mySolution21b Year Make Model 2019 Toyota Camry 2018 Honda Civic 2018 Hyundai Elantra Solution code: //Create a collection
ClearCollect(myCars21, { Year : 2016 , Make : "Toyota" , Model : "Corolla" }, { Year : 2014 , Make : "Honda" , Model : "Civic" }, { Year : 2019 , Make : "Toyota" , Model : "Camry" }, { Year : 2018 , Make : "Honda" , Model : "Civic" }, { Year : 2018 , Make : "Hyundai" , Model : "Elantra" }, { Year : 2020 , Make : "Honda" , Model : "Accord" } ); //Get middle rows code
ClearCollect( mySolution21b, LastN(FirstN(myCars21, 5 ), 3 ) ); 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 nxtM365 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