{"record":{"id":"a00be6a040227c23","repo":"Budibase/budibase","slug":"attempted-to-create-a-table-without-specifying-the","errorCode":null,"errorMessage":"attempted to create a table without specifying the table to create","messagePattern":"attempted to create a table without specifying the table to create","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/server/src/integrations/googlesheets.ts","lineNumber":439,"sourceCode":"      case Operation.READ:\n        return this.read({ ...json, sheet })\n      case Operation.UPDATE:\n        return this.update({\n          // exclude the header row and zero index\n          rowIndex: json.extra?.idFilter?.equal?.rowNumber,\n          sheet,\n          row: json.body,\n          table: json.table,\n        })\n      case Operation.DELETE:\n        return this.delete({\n          // exclude the header row and zero index\n          rowIndex: json.extra?.idFilter?.equal?.rowNumber,\n          sheet,\n        })\n      case Operation.CREATE_TABLE:\n        if (!json.table) {\n          throw new Error(\n            \"attempted to create a table without specifying the table to create\"\n          )\n        }\n        return this.createTable(json.table)\n      case Operation.UPDATE_TABLE:\n        if (!json.table) {\n          throw new Error(\n            \"attempted to create a table without specifying the table to create\"\n          )\n        }\n        return this.updateTable(json.table)\n      case Operation.DELETE_TABLE:\n        return this.deleteTable(json?.table?.name)\n      default:\n        throw new Error(\n          `GSheets integration does not support \"${json.operation}\".`\n        )\n    }","sourceCodeStart":421,"sourceCodeEnd":457,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/integrations/googlesheets.ts#L421-L457","documentation":"The Google Sheets integration's query() dispatches on json.operation. For Operation.CREATE_TABLE it requires json.table containing the sheet schema to create; without it there is nothing to write, so it throws before calling this.createTable.","triggerScenarios":"Calling query({ operation: 'CREATE_TABLE' }) with no `table` property (or table: null/undefined) on the Google Sheets integration.","commonSituations":"Manually constructed query payloads missing the table object; a caller that builds the JSON from user input where the table/schema step was skipped; UI flow that triggered table creation without a name/schema bound.","solutions":["Include a table object with at least a name and schema in the query JSON: { operation: 'CREATE_TABLE', table: { name: 'Sheet1', schema: {...} } }","Check the upstream code that constructs the query body to ensure json.table is bound before dispatch","Validate operation-specific payloads before invoking query"],"exampleFix":"// before\nawait integration.query({ operation: Operation.CREATE_TABLE })\n// after\nawait integration.query({ operation: Operation.CREATE_TABLE, table: { name: 'Customers', schema: { Name: { type: 'string', name: 'Name' } } } })","handlingStrategy":"validation","validationCode":"function assertCreateTablePayload(json) {\n  if (json.operation === 'CREATE_TABLE' && !json.table) {\n    throw new Error('CREATE_TABLE requires a table: { name, schema }')\n  }\n}","typeGuard":"function isCreateTablePayload(json) {\n  return json.operation === 'CREATE_TABLE' &&\n    typeof json.table === 'object' && json.table !== null &&\n    typeof json.table.name === 'string' && typeof json.table.schema === 'object'\n}","tryCatchPattern":"try {\n  await integration.query(json)\n} catch (err) {\n  if (err.message.includes('without specifying the table to create')) {\n    // reject payload upstream / require the table schema in the UI\n  } else throw err\n}","preventionTips":["Model payloads with a discriminated union so CREATE_TABLE demands a table object","Validate query JSON against a schema (e.g. zod) before calling query","Bind the table object from UI state at call time, not conditionally"],"tags":["google-sheets","validation","query"],"backgroundTag":"missing-required-parameter","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}