I have a Google spreadsheet where column A has checkboxes in each row. I have written a script to perform a function on all rows where the checkboxes are checked, but I want
How about this modification? I think that there are several solutions for your situation. So please think of this as one of them.
values[i].setValue(false);. values[i] is an array. Please use the range for setValue().
setValue() in the for loop leads to higher cost. So in this modification, I used setValues().values, if values[i][j] is "true".setValues().var dataRange = sheet.getRange('A3:A');
var values = dataRange.getValues();
for (var i = 0; i < values.length; i++) {
for (var j = 0; j < values[i].length; j++) {
if (values[i][j] == true) {
values[i][j] = false; // Modified
}
}
}
dataRange.setValues(values); // Added
If this was not what you want, please tell me. I would like to modify it.