Get The First Row With A Matching Value (Lookup)

Input collection: myCars30

SerialNoYearMake Model
64532016ToyotaCorolla
89462014HondaCivic
35712019ToyotaCamry
11652018HondaCivic
89732018HyundaiElantra
45292020HondaAccord


Output collection: mySolution30a (row with SerialNo 3571)

SerialNoYearMake Model
35712019ToyotaCamry


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")
);


Output collection: mySolution30b (row with SerialNo 4529)

SerialNoYearMakeModel
45292020HondaAccord


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")
);