{"record":{"id":"282323276c94f546","repo":"Budibase/budibase","slug":"table-id-is-unknown-cannot-find-table","errorCode":null,"errorMessage":"Table ID is unknown, cannot find table","messagePattern":"Table ID is unknown, cannot find table","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/server/src/api/controllers/row/ExternalRequest.ts","lineNumber":289,"sourceCode":"    rowId: string,\n    table: Table,\n    colName: string\n  ) {\n    const tableId = table._id!\n    const filters = this.prepareFilters(rowId, {}, table)\n    // safety check, if there are no filters on deletion bad things happen\n    if (Object.keys(filters).length !== 0) {\n      await makeExternalQuery({\n        endpoint: getEndpoint(tableId, Operation.UPDATE),\n        body: { [colName]: null },\n        filters,\n      })\n    }\n  }\n\n  getTable(tableId: string | undefined): Table | undefined {\n    if (!tableId) {\n      throw new Error(\"Table ID is unknown, cannot find table\")\n    }\n    const { tableName } = breakExternalTableId(tableId)\n    return this.tables[tableName]\n  }\n\n  async getRow(table: Table, rowId: string): Promise<Row> {\n    const response = await makeExternalQuery({\n      endpoint: getEndpoint(table._id!, Operation.READ),\n      filters: this.prepareFilters(rowId, {}, table),\n    })\n    if (Array.isArray(response) && response.length > 0) {\n      return response[0]\n    } else {\n      throw new Error(`Cannot fetch row by ID \"${rowId}\"`)\n    }\n  }\n\n  inputProcessing<T extends Row | undefined>(","sourceCodeStart":271,"sourceCodeEnd":307,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/api/controllers/row/ExternalRequest.ts#L271-L307","documentation":"ExternalRequest (the SQL/external-datasource row pipeline in Budibase server) resolves a table from an ID via getTable. External table IDs are composite (datasourceId:tableName), so if tableId is undefined/empty the code cannot even parse it, and it throws this error immediately. It is a fail-fast guard ensuring callers pass a valid table identifier.","triggerScenarios":"Calling table(), linkTable(), run(), destroy() or the [table, links] fetch with a row/request whose tableId property is undefined or empty string, e.g. an automation or API request referencing a deleted table or missing `tableId` field.","commonSituations":"Requests built from stale table IDs after a table was renamed/deleted; client or automation payloads missing tableId; code constructing external requests manually without setting the ID; REST/SQL datasource rows referencing the wrong composite ID format.","solutions":["Ensure the request/payload includes a valid, non-empty tableId before invoking the row pipeline","Re-fetch the table via the datasources API and use its current `_id` (the composite datasourceId:tableName value)","If the table was deleted/renamed, update automations, screens or API calls that hold the old ID"],"exampleFix":"// before\nawait externalRequest.table(undefined as any)\n// after\nconst tableId = table._id // e.g. \"datasourceId__tableName\"\nif (!tableId) throw new Error(\"Row payload missing table._id\")\nawait externalRequest.table(tableId)","handlingStrategy":"validation","validationCode":"function assertValidTableId(tableId?: string): asserts tableId is string {\n  if (!tableId || !tableId.includes(\"__\")) {\n    throw new Error(`Invalid external table id: ${tableId}`)\n  }\n}\nassertValidTableId(payload.tableId)","typeGuard":"const isExternalTableId = (id: unknown): id is string =>\n  typeof id === \"string\" && id.length > 0","tryCatchPattern":null,"preventionTips":["Always source tableId from the fetched table's `_id`, never hand-write it","Re-fetch table metadata after renames/deletes instead of caching IDs","Validate request payloads for tableId before calling row endpoints"],"tags":["server","external-datasource","missing-argument","sql"],"backgroundTag":"missing-required-table-id","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}