Remove A Row From A Collection

Input collection: myTrucks50

SerialYearMake Model
89432020FordF150
46232018ChevySilverado
23152019FordF150
54662020ChevyAvalanche


Output collection: mySolution50a (remove truck with Serial ‘4623’)

SerialYearMake Model
89432020FordF150
23152019FordF150
54662020ChevyAvalanche


Solution code:

//Create a collection
ClearCollect(myTrucks50,
{Serial: 8943, Year: 2020, Make: "Ford", Model: "F150"},
{Serial: 4623, Year: 2018, Make: "Chevy", Model: "Silverado" },
{Serial: 2315, Year: 2019, Make: "Ford", Model: "F150" },
{Serial: 5466, Year: 2020, Make: "Chevy",Model: "Avalanche"}
);

//Remove truck with serial 4623 code
ClearCollect(mySolution50a, myTrucks50);
Remove(mySolution50a,LookUp(mySolution50a,Serial=4623));


Output collection: mySolution50b (remove trucks with ‘Ford’ make)

SerialYearMake Model
46232018ChevySilverado
54662020ChevyAvalanche


Solution code:

//Create a collection
ClearCollect(myTrucks50,
{Serial: 8943, Year: 2020, Make: "Ford", Model: "F150"},
{Serial: 4623, Year: 2018, Make: "Chevy", Model: "Silverado" },
{Serial: 2315, Year: 2019, Make: "Ford", Model: "F150" },
{Serial: 5466, Year: 2020, Make: "Chevy",Model: "Avalanche"}
);

//Remove all trucks with Ford make code
ClearCollect(mySolution50b, myTrucks50);
RemoveIf(mySolution50b,Make="Ford");