Replace All Values In A Column

Input collection: myInspections18

LocationDateInspectionCompleted
Headquarters1/1/2020Yes
Branch 11/1/2020Yes
Branch 21/1/2020No
Branch 31/1/2020Yes
Branch 41/1/2020No


Output collection: mySolution18 (replace InspectionCompleted with ‘No’)

LocationDateInspectionCompleted
Headquarters1/1/2020No
Branch 11/1/2020No
Branch 21/1/2020No
Branch 31/1/2020No
Branch 41/1/2020No


Solution code:

//Create a collection
ClearCollect(myInspections18,
{Location: "Headquarters", Date: Date(2020,1,1), InspectionCompleted: "Yes"},
{Location: "Branch 1", Date: Date(2020,1,1), InspectionCompleted: "Yes"},
{Location: "Branch 2", Date: Date(2020,1,1), InspectionCompleted: "No"},
{Location: "Branch 3", Date: Date(2020,1,1), InspectionCompleted: "Yes"},
{Location: "Branch 4", Date: Date(2020,1,1), InspectionCompleted: "No"}
);

//Replace all values in a column code
ClearCollect(mySolution18,myInspections18);
UpdateIf(mySolution18,true,{InspectionCompleted: "No"})