Stamp new Google Form responses into a log tab

Runs on form submit and copies each response with a timestamp into a "Log" tab.

function onFormSubmit(e) {
  const ss = SpreadsheetApp.getActiveSpreadsheet();
  const log = ss.getSheetByName('Log') || ss.insertSheet('Log');
  log.appendRow([new Date(), ...e.values]);
}

How to install

  1. Open the spreadsheet, then Extensions > Apps Script.
  2. Paste the code, click Save.
  3. Choose the function in the toolbar and click Run once; approve the permissions screen (it lists exactly what the script can touch).
Safety: Install an "On form submit" trigger from the spreadsheet bound to the form.

Undo: Delete the trigger; the Log tab can be deleted safely.

Reference: Apps Script documentation.

Facts on this page checked December 4, 2026 (Pacific) against the linked official sources.