Preamble: never used javascript before, but trying to learn through google sheets since I work with tons of data.
Hello, I'm attempting to write a google script that will take the contents of a cell 8 columns to the left of a column of checkboxes and copy it somewhere else. When the checkbox is checked, that would be the trigger to copy the contents. I'm hesitant around selecting the entire K:K range, but don't know how to have the function look at all checkboxes and trigger on a change from FALSE to TRUE. Also have no idea if an IF statement is correct here.
function checkbox_track() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var request_log = ss.getSheetByName("Tracker")
var checkbox_range = request_log.getRange("K:K");
var timestamp = new Date();
var user = Session.getEffectiveUser().getEmail();
var tracker = ss.getSheetByName("Tracker");
if (checkbox_range == "TRUE") {
var metric_name = checkbox_range.offset(0,-8).getValue();
request_log.appendRow([timestamp, metric_name, user]);
}
}