How can I write a script to select the checkbox options based on value selected in a list field?

How can I write a script to select the checkbox options based on value selected in a list field?

Assume that "Options" is your picklist field and "Equipment" is your checkbox field. 

Copy code
if (input.Options  ==  "Tennis")
{
    Equipment.deselectall();
    Equipment.select("Racquet");
}
else if(input.Options == "Football")
{
    Equipment.deselectall();
    Equipment.select("Ball");
}


You'll need to put this in the On User Input action of the "Options" picklist.