{"record":{"id":"702701b65934c0b5","repo":"Budibase/budibase","slug":"table-not-found-702701","errorCode":null,"errorMessage":"Table not found","messagePattern":"Table not found","errorType":"http","errorClass":"HTTPError","httpStatus":404,"severity":"error","filePath":"packages/server/src/sdk/workspace/rowActions/crud.ts","lineNumber":249,"sourceCode":"    const { automationId } = actionsDoc.actions[rowActionId]\n    const automation = await automations.get(automationId)\n    await automations.remove(automation._id, automation._rev)\n\n    delete actionsDoc.actions[rowActionId]\n    return actionsDoc\n  })\n}\n\nexport async function run(\n  tableId: any,\n  rowActionId: any,\n  rowId: string,\n  user: User,\n  sourceId?: string\n) {\n  const table = await sdk.tables.getTable(tableId)\n  if (!table) {\n    throw new HTTPError(\"Table not found\", 404)\n  }\n\n  if (sourceId && isViewId(sourceId)) {\n    const result = await sdk.rows.search({\n      tableId,\n      viewId: sourceId,\n      query: { equal: { _id: rowId } },\n      limit: 1,\n    })\n    if (!result.rows.length) {\n      throw new HTTPError(\"Row not found\", 404)\n    }\n  }\n\n  const { automationId } = await get(tableId, rowActionId)\n  const automation = await sdk.automations.get(automationId)\n\n  const row = await sdk.rows.find(tableId, rowId)","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/sdk/workspace/rowActions/crud.ts#L231-L267","documentation":"Thrown by run in packages/server/src/sdk/workspace/rowActions/crud.ts when executing a row action against a tableId that does not resolve to an existing table. sdk.tables.getTable returns falsy and the run aborts before validating the view or row.","triggerScenarios":"Calling run(tableId, rowActionId, rowId, user, sourceId?) with a tableId for a table that was deleted, never existed, or is in another workspace/app.","commonSituations":"Automations that reference a table deleted during app development; external scripts with hardcoded table ids from a copied app; environment mismatch where the id comes from production but the script runs against local dev.","solutions":["Fetch the table first (sdk.tables.getTable) or list tables to confirm the tableId exists in the target workspace.","Correct the tableId — export the app or use the API to get the real id rather than hardcoding.","If the table was deleted, recreate it or update the automation/script to point at the replacement table."],"exampleFix":"// before\nawait rowActions.run(badTableId, rowActionId, rowId, user)\n// after\nconst table = await sdk.tables.getTable(tableId)\nif (table) await rowActions.run(tableId, rowActionId, rowId, user)","handlingStrategy":"validation","validationCode":"const table = await sdk.tables.getTable(tableId)\nif (!table) throw new Error(`Table ${tableId} does not exist in this workspace`)","typeGuard":null,"tryCatchPattern":"try {\n  await rowActions.run(tableId, rowActionId, rowId, user)\n} catch (e) {\n  if (e instanceof HTTPError && e.status === 404 && e.message === \"Table not found\") {\n    // refresh table list / fix automation table reference\n  } else throw e\n}","preventionTips":["Look up table ids dynamically instead of hardcoding them in automations or scripts.","Clean up automations and scripts when their target tables are deleted.","Confirm ids come from the same environment (dev vs prod) you are running against."],"tags":["not-found","tables","row-actions","http-404"],"backgroundTag":"resource-not-found","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}