Log deleted records to Google Sheets

Keep a copy of every record deleted from a table: use the built-in Delete Logs, or send each deleted record to a Google Sheet with Apps Script.

  • Verified Nov 17, 2026
  • Classic builder

On this page
  1. No code: the Delete Logs
  2. Send deleted records to a Google Sheet
  3. Check it worked

Sometimes you need a record of what was deleted. Tadabase already keeps one in its Delete Logs. If you want the deleted records in a Google Sheet as well, an outgoing webhook can send each one to a short Apps Script.

No code: the Delete Logs #

Open Settings > Logs > Records > Delete Logs to see the records deleted from your app. The logs your plan includes decide whether this screen is available.

To read the same log from your own code, call GET /api/v1/logs/deleted-record-logs with an API key that has Allow Logs turned on. Your plan must include the log API. See Logs API.

Send deleted records to a Google Sheet #

  1. Create the sheet and script Create a Google Sheet, choose Extensions > Apps Script and paste the script below. Replace the field slugs in FIELDS with the fields you want to keep.
  2. Store a shared secret In Project Settings > Script Properties, add SHARED_SECRET set to a long random string of your choice.
  3. Deploy it as a web app Choose Deploy > New deployment, select the Web app type, run it as yourself and give access to Anyone. Copy the web app URL.
  4. Add the webhook In the builder, go to Automation > Webhooks and click Add New Webhook. Give it a Name, pick the Data Table, and in URL paste the web app URL followed by ?key= and your shared secret.
  5. Choose the event Set Event to Delete Record and save.
javascript
// Adds a row to the "Deleted records" tab for every record a Tadabase webhook reports as deleted.
// Script Properties: SHARED_SECRET

var SHEET_NAME = 'Deleted records';
var FIELDS = ['field_36', 'field_40', 'field_42'];   // replace with your field slugs

function doPost(e) {
  var props = PropertiesService.getScriptProperties();
  if (!e.parameter.key || e.parameter.key !== props.getProperty('SHARED_SECRET')) {
    return ContentService.createTextOutput('forbidden');
  }

  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = spreadsheet.getSheetByName(SHEET_NAME) || spreadsheet.insertSheet(SHEET_NAME);
  if (sheet.getLastRow() === 0) {
    sheet.appendRow(['Logged at', 'Record ID'].concat(FIELDS));
  }

  // These webhooks send the record as form fields, one per field slug.
  var row = [new Date(), e.parameter.id || ''];
  FIELDS.forEach(function (slug) {
    row.push(e.parameter[slug] || '');
  });
  sheet.appendRow(row);

  return ContentService.createTextOutput('ok');
}

Each time a record of that table is deleted, a row is added with the time, the record's ID and the values of the fields you listed.

Check it worked #

  • Delete a test record and look for a new row in the Deleted records tab.
  • If no row appears, check the webhook's log (Outgoing webhook logs) and, in the Apps Script editor, Executions.
  • After you change the script, deploy a new version (Deploy > Manage deployments) so the web app URL runs the new code.

Was this page helpful?

Something wrong or missing on this page? Tell us.