Auto remove blank rows in google docs

I don’t think its possible to do this with the API @Jason_Blignaut . You probably have to use a Google Apps Script within the sheet which runs a function to find empty rows.
This is an example, which only deletes the first empty row it find, based on a check of the first column “A:A”:

function getFirstEmptyRowByColumnArray() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var column = ss.getRange('A:A');
  var values = column.getValues(); // get all data in one call
  var ct = 0;
  while ( values[ct] && values[ct][0] != "" ) {
    ct++;
  }
  console.log(`Deleting ${ct+1}`);
  ss.deleteRow(ct+1);
}
2 Likes