Input collection: myCars12
| Year | Make | Model |
| 2016 | Toyota | Corolla |
| 2014 | Honda | Civic |
| 2019 | Toyota | Camry |
| 2018 | Honda | Civic |
| 2018 | Hyundai | Elantra |
| 2020 | Honda | Accord |
Output collection: mySolution12a
| Year | Make | Model |
| 2016 | Toyota | Corolla |
Solution code:
//Create a collection ClearCollect(myCars12, {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 the first row only code ClearCollect( mySolution12a, First(myCars12) ); Code language: JavaScript (javascript)
Output collection: mySolution12b
| Year | Make | Model |
| 2016 | Toyota | Corolla |
| 2014 | Honda | Civic |
| 2019 | Toyota | Camry |
Solution code:
//Create a collection ClearCollect(myCars12, {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 the first rows code ClearCollect( mySolution12b, FirstN(myCars12,3) ); Code language: JavaScript (javascript)