{"record":{"id":"99fd227ab6d6a345","repo":"Budibase/budibase","slug":"invalid-format-for-field-columnname-colum-99fd22","errorCode":null,"errorMessage":"Invalid format for field \"${columnName}\": \"${columnData}\". Time-only fields must be in the format \"HH:MM:SS\".","messagePattern":"Invalid format for field \"(.+?)\": \"(.+?)\"\\. Time-only fields must be in the format \"HH:MM:SS\"\\.","errorType":"http","errorClass":"HTTPError","httpStatus":400,"severity":"error","filePath":"packages/server/src/utilities/schema.ts","lineNumber":202,"sourceCode":"                400\n              )\n            }\n            parsedRow[columnName] = new Date(columnData.trim() + \"Z\")\n          } else {\n            if (!sql.utils.isValidISODateString(columnData)) {\n              let message = `Invalid format for field \"${columnName}\": \"${columnData}\".`\n              if (columnSchema.dateOnly) {\n                message += ` Date-only fields must be in the format \"YYYY-MM-DD\".`\n              } else {\n                message += ` Datetime fields must be in ISO format, e.g. \"YYYY-MM-DDTHH:MM:SSZ\".`\n              }\n              throw new HTTPError(message, 400)\n            }\n          }\n        }\n        if (columnData && columnSchema.timeOnly) {\n          if (!sql.utils.isValidTime(columnData)) {\n            throw new HTTPError(\n              `Invalid format for field \"${columnName}\": \"${columnData}\". Time-only fields must be in the format \"HH:MM:SS\".`,\n              400\n            )\n          }\n        }\n        parsedRow[columnName] = columnData\n      } else if (\n        columnType === FieldType.JSON &&\n        typeof columnData === \"string\"\n      ) {\n        parsedRow[columnName] = parseJsonExport(columnData)\n      } else if (columnType === FieldType.BB_REFERENCE) {\n        let parsedValues: { _id: string }[] = columnData || []\n        if (columnData && typeof columnData === \"string\") {\n          parsedValues = parseJsonExport<{ _id: string }[]>(columnData)\n        }\n\n        parsedRow[columnName] = parsedValues?.map(u => u._id)","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/utilities/schema.ts#L184-L220","documentation":"An HTTP 400 thrown in packages/server/src/utilities/schema.ts when a value is provided for a column with timeOnly: true and it fails the TIME_REGEX validation (isValidTime in backend-core/src/sql/utils.ts). Time-only columns store just a time of day, so the value must be exactly \"HH:MM:SS\" (24-hour); anything else (e.g. \"10:00 AM\", \"10:00\") is rejected.","triggerScenarios":"Saving a row, importing CSV, or API call where a timeOnly column receives \"10:00\" (missing seconds), \"10:00:00 AM\" (12-hour/meridiem), \"10am\", or an empty-ish non-time string.","commonSituations":"Spreadsheet time cells exporting as \"10:00 AM\"; HTML <input type=\"time\"> values that omit seconds (\"HH:MM\"); UI form components for time pickers posting partial times.","solutions":["Normalise the value to 24-hour \"HH:MM:SS\" with seconds included before sending.","Convert 12-hour formats by parsing meridiem and adding 12 to PM hours.","Append \":00\" when the source only supplies HH:MM.","Pre-validate with a /^\\d{2}:\\d{2}:\\d{2}$/ style check matching isValidTime before the API call."],"exampleFix":"// before\nrow[\"startTime\"] = \"10:00 AM\"\n// after\nrow[\"startTime\"] = \"10:00:00\"","handlingStrategy":"validation","validationCode":"const TIME_RE = /^\\d{2}:\\d{2}:\\d{2}$/\nfunction normaliseTime(input: string): string {\n  const m = input.trim().match(/^(\\d{1,2}):(\\d{2})(?::(\\d{2}))?\\s*([AaPp][Mm])?$/)\n  if (!m) throw new Error(`Invalid time: ${input}`)\n  let h = Number(m[1])\n  const meridiem = m[4]?.toUpperCase()\n  if (meridiem === \"PM\" && h < 12) h += 12\n  if (meridiem === \"AM\" && h === 12) h = 0\n  return `${String(h).padStart(2, \"0\")}:${m[2]}:${m[3] ?? \"00\"}`\n}\nif (!TIME_RE.test(row.startTime)) row.startTime = normaliseTime(row.startTime)","typeGuard":"function isHhMmSs(v: unknown): v is string {\n  return typeof v === \"string\" && /^\\d{2}:\\d{2}:\\d{2}$/.test(v)\n}","tryCatchPattern":"try {\n  await saveRow(row)\n} catch (e) {\n  if (e instanceof HTTPError && e.status === 400 && /Time-only/.test(e.message)) {\n    row.startTime = normaliseTime(row.startTime)\n    await saveRow(row)\n  } else throw e\n}","preventionTips":["Configure time pickers/components to emit 24-hour HH:MM:SS","Append :00 when sources only provide HH:MM","Convert 12-hour AM/PM input before sending","Pre-validate time columns with a strict HH:MM:SS regex in importers"],"tags":["validation","time","bad-request"],"backgroundTag":"invalid-time-format","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}