Ask Your Question

Revision history [back]

You can use the onEdit() trigger of Google Apps Script to capture changes in the sheet and then use a conditional statement to check if the value of the cell has changed from false to true. If the condition is met, you can set the adjacent cell value to "true" using the setValue() method. Here's a sample code:

function onEdit(e) {
  var sheet = e.source.getActiveSheet();
  var range = e.range;
  if (range.getColumn() == 1 && range.getRow() > 1 && range.getValue() == true && range.offset(0, 1).getValue() == false) {
    range.offset(0, 1).setValue("true");
  }
}

This code checks if the edited range is in column 1 (change this as per your requirement) and the value of the cell has changed from false to true. If the condition is met, it sets the adjacent cell value to "true". You can modify the code as per your specific requirements.