Get The First Row With A Matching Value (Lookup)
Get The First Row With A Matching Value (Lookup) Input collection: myCars30 SerialNo Year Make Model 6453 2016 Toyota Corolla 8946 2014 Honda Civic 3571 2019...
- Published
- Reading time
- 2 min read
Before you start
Is this guide for you?
- Best entry point
- Power Apps
- Time investment
- 2 min read
Imported reference from Matthew Devaney's blog for learning purposes. Original: https://www.matthewdevaney.com/powerapps-collections-cookbook/get-the-row-with-a-matching-unique-value/. Author: Matthew Devaney.
Get The First Row With A Matching Value (Lookup) Input collection: myCars30 SerialNo Year Make Model 6453 2016 Toyota Corolla 8946 2014 Honda Civic 3571 2019 Toyota Camry 1165 2018 Honda Civic 8973 2018 Hyundai Elantra 4529 2020 Honda Accord
Output collection: mySolution30a (row with SerialNo 3571) SerialNo Year Make Model 3571 2019 Toyota Camry Solution code: //Create a collection
ClearCollect(myCars30, { SerialNo : "6453" , Year : 2016 , Make : "Toyota" , Model : "Corolla" }, { SerialNo : "8946" , Year : 2014 , Make : "Honda" , Model : "Civic" }, { SerialNo : "3571" , Year : 2019 , Make : "Toyota" , Model : "Camry" }, { SerialNo : "1165" , Year : 2018 , Make : "Honda" , Model : "Civic" }, { SerialNo : "8973" , Year : 2018 , Make : "Hyundai" , Model : "Elantra" }, { SerialNo : "4529" , Year : 2020 , Make : "Honda" , Model : "Accord" } );
//Get row with matching unique value code
ClearCollect( mySolution30a, LookUp(myCars30,SerialNo= "3571" ) ); Code language: JavaScript ( javascript )
Output collection: mySolution30b (row with SerialNo 4529) SerialNo Year Make Model 4529 2020 Honda Accord Solution code: //Create a collection
ClearCollect(myCars30, { SerialNo : "6453" , Year : 2016 , Make : "Toyota" , Model : "Corolla" }, { SerialNo : "8946" , Year : 2014 , Make : "Honda" , Model : "Civic" }, { SerialNo : "3571" , Year : 2019 , Make : "Toyota" , Model : "Camry" }, { SerialNo : "1165" , Year : 2018 , Make : "Honda" , Model : "Civic" }, { SerialNo : "8973" , Year : 2018 , Make : "Hyundai" , Model : "Elantra" }, { SerialNo : "4529" , Year : 2020 , Make : "Honda" , Model : "Accord" } );
//Get row with matching unique value code
ClearCollect( mySolution30b, LookUp(myCars30,SerialNo= "4529" ) ); Code language: JavaScript ( javascript )
Tagged
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