I have a daily task list with check boxes for each task that is accessed by multiple coworkers multiple times per day. I'm currently using the below script to change the color of the cells based onEdit for WHO edited the cell, however I want to change it to ONLY change to their color IF they check the box (TRUE) and for it to go back to no color if the box is unchecked (if I accidentally check a box, or check the wrong box). How can I change my script to do this?
function onEdit(e) {// Get the current user's email addressvar userEmail = Session.getActiveUser().getEmail();
// Set the background color of the edited cell based on the userif (userEmail === "user1@example.com") {e.range.setBackground("yellow");} else if (userEmail === "user2@example.com") {e.range.setBackground("green");} else {e.range.setBackground("red");}}