List all tables and field slugs in Google Sheets

An Apps Script that writes every table of your app, with each field's name, slug and type, to a Google Sheet you can keep beside your API code.

  • Verified Nov 17, 2026
  • Classic builder

On this page
  1. Before you start
  2. Set it up
  3. What the sheet shows
  4. Common problems

API calls name tables by ID and fields by slug, such as field_36. This Google Apps Script writes all of them to a sheet: one row per field, with its table's name and ID, the field's name, slug and type.

Before you start #

You need an API key for the app with Allow Reads turned on, and its App ID, API key and API secret. See Get your API keys.

Set it up #

  1. Open Apps Script Create a Google Sheet, then choose Extensions > Apps Script.
  2. Paste the script Delete the sample code, paste the script below and save the project.
  3. Store your keys Open Project Settings (the gear icon) and, under Script Properties, add TADABASE_APP_ID, TADABASE_API_KEY and TADABASE_API_SECRET.
  4. Run it Reload the sheet and choose Tadabase > List tables and fields, or select listTablesAndFields in the editor and click Run. Google asks you to authorize the script the first time.
javascript
// Writes every table and field of a Tadabase app to the "Tables and fields" tab.
// Set these Script Properties first (Project Settings > Script Properties):
// TADABASE_APP_ID, TADABASE_API_KEY, TADABASE_API_SECRET

var SHEET_NAME = 'Tables and fields';

function onOpen() {
  SpreadsheetApp.getUi()
    .createMenu('Tadabase')
    .addItem('List tables and fields', 'listTablesAndFields')
    .addToUi();
}

// GETs a path under /api/v1 and stops with a readable message if the call fails.
function callApi_(path) {
  var props = PropertiesService.getScriptProperties();
  for (var attempt = 0; attempt <= 5; attempt++) {
    var response = UrlFetchApp.fetch('https://api.tadabase.io/api/v1' + path, {
      method: 'get',
      headers: {
        'X-Tadabase-App-Id': props.getProperty('TADABASE_APP_ID'),
        'X-Tadabase-App-Key': props.getProperty('TADABASE_API_KEY'),
        'X-Tadabase-App-Secret': props.getProperty('TADABASE_API_SECRET')
      },
      muteHttpExceptions: true
    });
    var code = response.getResponseCode();
    if (code === 429) { // rate limited: wait as long as the API asks, then retry
      var headers = response.getHeaders();
      Utilities.sleep(Math.min(Number(headers['Retry-After'] || headers['retry-after']) || 60, 60) * 1000);
      continue;
    }
    var body = JSON.parse(response.getContentText());
    if (code !== 200 || body.type !== 'success') {
      throw new Error('Tadabase API error ' + code + ': ' + (body.msg || response.getContentText()));
    }
    return body;
  }
  throw new Error('The API is still rate limiting. Try again later.');
}

function listTablesAndFields() {
  var rows = [['Table', 'Table ID', 'Field', 'Field slug', 'Type']];
  var tables = callApi_('/data-tables').data_tables;
  tables.forEach(function (table) {
    var fields = callApi_('/data-tables/' + table.id + '/fields').fields;
    fields.forEach(function (field) {
      rows.push([table.name, table.id, field.name, field.slug, field.type]);
    });
  });

  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = spreadsheet.getSheetByName(SHEET_NAME) || spreadsheet.insertSheet(SHEET_NAME);
  sheet.clearContents();
  sheet.getRange(1, 1, rows.length, rows[0].length).setValues(rows);
}

What the sheet shows #

ColumnComes from
Table, Table IDGET /api/v1/data-tables, which returns data_tables: each table's id and name.
Field, Field slug, TypeGET /api/v1/data-tables/{tableId}/fields, which returns fields: each field's name, slug and type.
  • Only tables that are visible in the Data Builder are listed.
  • The type is the field type's internal name. Most match the builder, but a connection field shows as Join and a date range field as Calendar. See Field types reference.
  • Run the script again after you add or rename fields: it replaces the tab's contents each time.
  • For descriptions, default values and the options of choice fields, call GET /api/v1/data-tables/{tableId}/full-fields-info instead of /fields.

Common problems #

What you seeWhat to do
No Tadabase menuReload the sheet and wait a few seconds, or run listTablesAndFields from the editor.
Tadabase API error 412The key is not allowed to read. Turn on Allow Reads for it.
Another Tadabase API errorCheck the three Script Properties and that the key's status is active.

Was this page helpful?

Something wrong or missing on this page? Tell us.