[Google Apps Script] Append a row to a Google Sheet

Created on November 30, 2026

You can call appendRow() on a sheet to add a row after its existing data. Pass an array of values in column order. The first element goes in column A, the second in column B, and so on.

function main() {
  var spreadsheet = SpreadsheetApp.openByUrl("https://example.com/your/spreadsheet/url");
  var sheet = spreadsheet.getSheetByName("some_sheet");
  sheet.appendRow(["one", "two", "three"]);
}

Replace the URL with the address of a spreadsheet you can edit and some_sheet with the name of the destination tab.

The appended row contains one, two, and three in columns A, B, and C

Google Apps Script