google sheet scripts get last row with data 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);