{"record":{"id":"0d7eb4dea7f9abe3","repo":"Budibase/budibase","slug":"id-json-stringify-value-is-not-valid-for-the","errorCode":null,"errorMessage":"Id \"${JSON.stringify(value)}\" is not valid for the subtype \"USER\"","messagePattern":"Id \"(.+?)\" is not valid for the subtype \"USER\"","errorType":"validation","errorClass":"InvalidBBRefError","httpStatus":null,"severity":"error","filePath":"packages/server/src/utilities/rowProcessor/bbReferenceProcessor.ts","lineNumber":20,"sourceCode":"import { utils } from \"@budibase/shared-core\"\nimport {\n  BBReferenceFieldSubType,\n  DocumentType,\n  SEPARATOR,\n  User,\n} from \"@budibase/types\"\nimport { getUserFullName } from \"../users\"\nimport { InvalidBBRefError } from \"./errors\"\n\nconst ROW_PREFIX = DocumentType.ROW + SEPARATOR\n\nexport async function processInputBBReference(\n  value: string | { _id: string },\n  subtype: BBReferenceFieldSubType.USER\n): Promise<string | null> {\n  if (value && Array.isArray(value)) {\n    if (value.length > 1) {\n      throw new InvalidBBRefError(\n        JSON.stringify(value),\n        BBReferenceFieldSubType.USER\n      )\n    }\n    value = value[0]\n  }\n  let id = typeof value === \"string\" ? value : value?._id\n\n  if (!id) {\n    return null\n  }\n\n  switch (subtype) {\n    case BBReferenceFieldSubType.USER: {\n      if (id.startsWith(ROW_PREFIX)) {\n        id = dbCore.getGlobalIDFromUserMetadataID(id)\n      }\n","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/utilities/rowProcessor/bbReferenceProcessor.ts#L2-L38","documentation":"Error \"Id \"${JSON.stringify(value)}\" is not valid for the subtype \"USER\"\" thrown in Budibase/budibase.","triggerScenarios":"Thrown at packages/server/src/utilities/rowProcessor/bbReferenceProcessor.ts:20 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"}