{"record":{"id":"243f2da23eef5e86","repo":"payloadcms/payload","slug":"the-hierarchy-title-field-titlefieldname-was","errorCode":null,"errorMessage":"The hierarchy title field \"${titleFieldName}\" was not found. It cannot be nested within named fields i.e. named groups, named tabs, etc.","messagePattern":"The hierarchy title field \"(.+?)\" was not found\\. It cannot be nested within named fields i\\.e\\. named groups, named tabs, etc\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/payload/src/hierarchy/utils/findUseAsTitle.ts","lineNumber":87,"sourceCode":"        break\n      case 'tabs':\n        for (const tab of field.tabs) {\n          if (!('name' in tab)) {\n            const result = iterateFields({ fields: tab.fields, titleFieldName })\n            if (result) {\n              titleField = result\n            }\n          }\n        }\n    }\n\n    // If we found the field in recursion, return it\n    if (titleField) {\n      return titleField\n    }\n  }\n\n  throw new Error(\n    `The hierarchy title field \"${titleFieldName}\" was not found. It cannot be nested within named fields i.e. named groups, named tabs, etc.`,\n  )\n}\n","sourceCodeStart":69,"sourceCodeEnd":91,"githubUrl":"https://github.com/payloadcms/payload/blob/00c58b35c0ed348ddc22daabf467b139727214fd/packages/payload/src/hierarchy/utils/findUseAsTitle.ts#L69-L91","documentation":"Thrown by findUseAsTitleField.iterateFields when the field named by admin.useAsTitle cannot be located among the top-level or unnamed-group/unnamed-tab fields. The title lookup deliberately does not descend into named groups or named tabs, so a title field hidden inside one is not found.","triggerScenarios":"Setting admin.useAsTitle to a field that lives inside a named group or a named tab, on a collection with hierarchy enabled. Triggered when hierarchy code calls findUseAsTitleField during rendering/ancestry.","commonSituations":"Moving a title field into a named tab during a refactor; setting useAsTitle to a nested field expecting deep lookup; enabling hierarchy on a collection whose title is inside a named group.","solutions":["Move the title field to the top level (or into an unnamed group/tab such as a row/collapsible).","Point admin.useAsTitle at a top-level field instead.","If the nested location is required, add a top-level alias field and populate it via a hook.","Leave useAsTitle unset to fall back to 'id'."],"exampleFix":"// before\nfields: [\n  { name: 'meta', type: 'group', fields: [\n    { name: 'title', type: 'text' },\n  ] },\n],\nadmin: { useAsTitle: 'title' },\nhierarchy: true,\n\n// after\nfields: [\n  { name: 'title', type: 'text' },\n],\nadmin: { useAsTitle: 'title' },\nhierarchy: true,","handlingStrategy":"validation","validationCode":"// helper: confirm useAsTitle is reachable at top level\nimport { iterateFields } from './findUseAsTitle'\ntry {\n  iterateFields({ fields: collectionConfig.fields, titleFieldName })\n} catch {\n  throw new Error(`useAsTitle '${titleFieldName}' must be top-level / unnamed-group`)\n}","typeGuard":"function titleFieldIsTopLevel(fields: Field[], name: string): boolean {\n  return fields.some(\n    (f) =>\n      'name' in f && f.name === name &&\n      ['text', 'number', 'textarea'].includes(f.type),\n  )\n}","tryCatchPattern":null,"preventionTips":["Keep the title field at the top level of the collection, not inside named groups/tabs.","Leave admin.useAsTitle unset to fall back to 'id'."],"tags":["hierarchy","config","use-as-title","fields","validation"],"backgroundTag":null,"analyzedSha":"00c58b35c0ed348ddc22daabf467b139727214fd","analyzedAt":"2026-08-12T20:45:03.758Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}