apps script get Range rows code example
Example 1: google script get sheet size
var lastColumn = sheet.getLastColumn();
// Returns the position of the last column that has content.
Example 2: 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);