{"record":{"id":"8a72fa6acfc2b581","repo":"Budibase/budibase","slug":"invalid-default-value-for-field-key-err-m","errorCode":null,"errorMessage":"Invalid default value for field '${key}' - ${err.message}","messagePattern":"Invalid default value for field '(.+?)' - (.+?)","errorType":"http","errorClass":"HTTPError","httpStatus":400,"severity":"error","filePath":"packages/server/src/utilities/rowProcessor/index.ts","lineNumber":184,"sourceCode":"    const isEmpty =\n      row[key] == null ||\n      row[key] === \"\" ||\n      (Array.isArray(row[key]) && row[key].length === 0)\n\n    if (\"default\" in schema && schema.default != null && isEmpty) {\n      let processed: string | string[]\n      if (Array.isArray(schema.default)) {\n        processed = schema.default.map(val => processStringSync(val, ctx))\n      } else if (typeof schema.default === \"string\") {\n        processed = processStringSync(schema.default, ctx)\n      } else {\n        processed = schema.default\n      }\n\n      try {\n        row[key] = coerce(processed, schema.type)\n      } catch (err: any) {\n        throw new HTTPError(\n          `Invalid default value for field '${key}' - ${err.message}`,\n          400\n        )\n      }\n    }\n  }\n}\n\n/**\n * This will coerce a value to the correct types based on the type transform map\n * @param value The value to coerce\n * @param type The type fo coerce to\n * @returns The coerced value\n */\nexport function coerce(value: string | Date | string[], type: FieldType) {\n  // no coercion specified for type, skip it\n  if (!TYPE_TRANSFORM_MAP[type]) {\n    return value","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/utilities/rowProcessor/index.ts#L166-L202","documentation":"Error \"Invalid default value for field '${key}' - ${err.message}\" thrown in Budibase/budibase.","triggerScenarios":"Thrown at packages/server/src/utilities/rowProcessor/index.ts:184 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}