I wrote a script for the google spreadsheet to save the logs of a single sheet. but this script writes the date in the first column, including for empty cells. For example, if there are 1000 rows on the test1 sheet, of which only 50 are filled, the script will still bring 1000 rows to the tech.logs tab. I want it to process only those rows from the test1 sheet in which the first column is not empty. I tried to implement this via if (! cell.isBlank ()) but I get the error "This is not a function". How can I do this?
function recordHistory() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var inputSheet = ss.getSheetByName("test1");
var source = inputSheet.getRange("A2:AX");
var values = source.getValues();
for (var i=0; i<values.length; i++) values[i][0] = new Date();
var outputSheet = ss.getSheetByName("tech.logs");
outputSheet.getRange(outputSheet.getLastRow()+1,1,values.length,values[0].length).setValues(values);
var range = outputSheet.getRange("A1:A");
range.sort(1);
};