{"record":{"id":"35ac8811dbc6d96a","repo":"Budibase/budibase","slug":"id-notfoundids-0-is-not-valid-for-the-subtyp","errorCode":null,"errorMessage":"Id \"${notFoundIds[0]}\" 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":95,"sourceCode":"  // they may be user metadata references (start with row prefix)\n  // and these need to be converted to global IDs\n  referenceIds = referenceIds.map(id => {\n    if (id?.startsWith(ROW_PREFIX)) {\n      return dbCore.getGlobalIDFromUserMetadataID(id)\n    } else {\n      return id\n    }\n  })\n\n  switch (subtype) {\n    case undefined:\n      throw \"Subtype must be defined\"\n    case BBReferenceFieldSubType.USER:\n    case BBReferenceFieldSubType.USERS: {\n      const { notFoundIds } = await cache.user.getUsers(referenceIds)\n\n      if (notFoundIds?.length) {\n        throw new InvalidBBRefError(\n          notFoundIds[0],\n          BBReferenceFieldSubType.USER\n        )\n      }\n\n      if (!referenceIds?.length) {\n        return null\n      }\n\n      return referenceIds\n    }\n    default:\n      throw utils.unreachable(subtype)\n  }\n}\n\ninterface UserReferenceInfo {\n  _id: string","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/utilities/rowProcessor/bbReferenceProcessor.ts#L77-L113","documentation":"Error \"Id \"${notFoundIds[0]}\" is not valid for the subtype \"USER\"\" thrown in Budibase/budibase.","triggerScenarios":"Thrown at packages/server/src/utilities/rowProcessor/bbReferenceProcessor.ts:95 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"}