{"record":{"id":"a9f78c952f9d17c0","repo":"RocketChat/Rocket.Chat","slug":"some-custom-fields-were-not-processed","errorCode":null,"errorMessage":"Some custom fields were not processed","messagePattern":"Some custom fields were not processed","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"apps/meteor/server/lib/omnichannel/custom-fields.ts","lineNumber":148,"sourceCode":"\t\t\t\tprev[`livechatData.${curr.key}`] = curr.value;\n\t\t\t}\n\n\t\t\treturn prev;\n\t\t},\n\t\t{} as Record<string, string>,\n\t);\n\n\tif (Object.keys(visitorCustomFieldsToUpdate).length) {\n\t\tawait LivechatVisitors.updateAllLivechatDataByToken(visitor.token, visitorCustomFieldsToUpdate);\n\t}\n\n\tconst contacts = await LivechatContacts.findAllByVisitorId(visitor._id).toArray();\n\tif (contacts.length) {\n\t\tawait Promise.all(contacts.map((contact) => updateContactsCustomFields(contact, validCustomFields)));\n\t}\n\n\tif (validCustomFields.length !== keys.length) {\n\t\tlivechatLogger.warn({\n\t\t\tmsg: 'Some custom fields were not processed',\n\t\t\tvisitorId: visitor._id,\n\t\t\tmissingKeys: keys.filter((key) => !validCustomFields.map((v) => v.key).includes(key)),\n\t\t});\n\t}\n\n\treturn true;\n}\n\nexport async function setMultipleCustomFields({\n\tvisitor,\n\tcustomFields,\n}: {\n\tvisitor: ILivechatVisitor;\n\tcustomFields: {\n\t\tkey: string;\n\t\tvalue: string;\n\t\toverwrite: boolean;","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/2a7de457074cbb4d4373fbd9a4e5bea292c9c764/apps/meteor/server/lib/omnichannel/custom-fields.ts#L130-L166","documentation":"While processing an omnichannel visitor's custom fields, Rocket.Chat matched the submitted keys against the Livechat custom fields defined in settings; validCustomFields ended up shorter than the submitted keys, so at least one key had no matching definition. Undefined keys are skipped and the missingKeys list in the log shows exactly which ones.","triggerScenarios":"A visitor registration / page-visited / custom-field API call sends 'customFields' containing keys that are not defined in Administration > Omnichannel > Custom Fields — typo, casing mismatch, or a field that was never created.","commonSituations":"Website widget script sending fields the admin never configured; a field renamed or removed server-side while the website still posts the old key; integrations built against a different workspace's field set.","solutions":["Read missingKeys from the log entry — those exact keys are undefined","Create each missing field in Administration > Omnichannel > Custom Fields using the identical key/name","Or fix/stop sending the stale key from the website script or integration payload","Match key names exactly, including casing and underscores"],"exampleFix":"// before\n// API sends: { customFields: { departement: 'sales' } }\n// Custom Fields has key: 'department'\n\n// after\n// API sends: { customFields: { department: 'sales' } }","handlingStrategy":"validation","validationCode":"const definedKeys = new Set((await LivechatCustomField.find({}, { fields: { _id: 1 } }).fetch()).map((f) => f._id));\nconst unknown = Object.keys(submittedCustomFields).filter((key) => !definedKeys.has(key));\nif (unknown.length) {\n  throw new Meteor.Error('invalid-custom-fields', `Unknown custom fields: ${unknown.join(', ')}`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Define every field in Administration > Omnichannel > Custom Fields before the widget sends it","Treat field keys as an API contract: rename on both sides atomically","Log unknown keys during development to catch casing/typo mismatches early"],"tags":["omnichannel","livechat","custom-fields","validation"],"backgroundTag":"unknown-custom-field","analyzedSha":"2a7de457074cbb4d4373fbd9a4e5bea292c9c764","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}