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
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 #
- Open Apps Script Create a Google Sheet, then choose Extensions > Apps Script.
- Paste the script Delete the sample code, paste the script below and save the project.
- Store your keys Open Project Settings (the gear icon) and, under Script Properties, add
TADABASE_APP_ID,TADABASE_API_KEYandTADABASE_API_SECRET. - Run it Reload the sheet and choose Tadabase > List tables and fields, or select
listTablesAndFieldsin the editor and click Run. Google asks you to authorize the script the first time.
// 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 #
| Column | Comes from |
|---|---|
| Table, Table ID | GET /api/, which returns data_tables: each table's id and name. |
| Field, Field slug, Type | GET /api/, 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
Joinand a date range field asCalendar. 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-infoinstead of/fields.
Common problems #
| What you see | What to do |
|---|---|
| No Tadabase menu | Reload the sheet and wait a few seconds, or run listTablesAndFields from the editor. |
Tadabase API error 412 | The key is not allowed to read. Turn on Allow Reads for it. |
Another Tadabase API error | Check 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.