Input collection: myTrucks42
Serial | Year | Make | Model |
9394 | 2020 | Ford | F150 |
5978 | 2018 | Chevy | Silverado |
1235 | 2016 | GM | Yukon |
Output collection: mySolution42 (replace row with Serial ‘5978’)
Serial | Year | Make | Model |
9394 | 2020 | Ford | F150 |
3040 | 2019 | Dodge | Ram |
1235 | 2016 | GM | Yukon |
Solution code:
//Create a collection
ClearCollect(myTrucks42,
{Serial: 9394, Year: 2020, Make: "Ford", Model: "F150"},
{Serial: 5978, Year: 2018, Make: "Chevy", Model: "Silverado"},
{Serial: 1235, Year: 2016, Make: "GM", Model: "Yukon"}
);
//Replace a row code
ClearCollect(mySolution42, myTrucks42);
Set(myNewTruck42,{Serial: 3040, Year: 2019, Make: "Dodge", Model: "Ram"});
Update(mySolution42,LookUp(mySolution42,Serial=5978),myNewTruck42);