get last row with data google sheets apps script code example
Example: google script last row
var cells = sheetInput.getRange("a:a").getValues();//Gets all cells in col A.
var filter = cells.filter((cell) => cell != "");//filters out the blanks.
var lr = parseInt(filter.length) + 1;//This is the Last Row.
Logger.log(lr);