Describe the Bug
admin.listSearchableFields accepts a dotted path to a field inside an array (e.g. ['submissionData.value'] on the form-builder plugin's form-submissions). The search itself works — mergeListSearchAndWhere maps each configured string straight to { [path]: { like: search } }, and a dotted path is a valid query path — but the search box's placeholder doesn't know the field: it falls back to the title field and reads "Search by ID", telling the user it searches the row id when it searches what they typed.
Cause: getTextFieldsToBeSearched flattens the collection's fields with flattenTopLevelFields(fields, { moveSubFieldsToTop: true }), which descends into group, tabs, row and collapsible fields but never arrays, and then matches the configured strings against the bare field.name. 'submissionData.value' matches nothing.
Link to the code path
3.x:
packages/ui/src/elements/ListControls/getTextFieldsToBeSearched.ts (whole file — the searchableFieldNames.has(field.name) match)
packages/ui/src/elements/ListControls/index.tsx builds the placeholder from its result
packages/payload/src/utilities/mergeListSearchAndWhere.ts (the search that does work)
On main the placeholder is simplified to plain "Search" (ListControls/index.tsx, "Simplified placeholder"), so this only affects 3.x.
Reproduction Steps
- Any collection with an array field holding a text subfield, e.g.
fields: [{ name: 'items', type: 'array', fields: [{ name: 'value', type: 'text' }] }],
admin: { listSearchableFields: ['items.value'] },
(form-submissions from @payloadcms/plugin-form-builder with listSearchableFields: ['submissionData.value'] is the real case.)
- Open the list view. The search box says "Search by ID".
- Type text that appears in
items.value → the rows filter correctly.
Confirmed on 3.86.0 and, by reading the source, 3.89.0.
Expected Behavior
The placeholder names the field(s) actually searched ("Search by Value"), or at least doesn't claim "ID".
Actual Behavior
"Search by ID" while the search matches the array subfield.
Proposed fix
Resolve dotted paths in getTextFieldsToBeSearched: match against each flattened field's full path (and descend array fields), or, as main does, drop the field list from the placeholder.
Environment
- Payload 3.86.0 (confirmed in the admin), 3.89.0 (source read)
@payloadcms/plugin-form-builder, @payloadcms/db-postgres, Next.js 16
Describe the Bug
admin.listSearchableFieldsaccepts a dotted path to a field inside an array (e.g.['submissionData.value']on the form-builder plugin'sform-submissions). The search itself works —mergeListSearchAndWheremaps each configured string straight to{ [path]: { like: search } }, and a dotted path is a valid query path — but the search box's placeholder doesn't know the field: it falls back to the title field and reads "Search by ID", telling the user it searches the row id when it searches what they typed.Cause:
getTextFieldsToBeSearchedflattens the collection's fields withflattenTopLevelFields(fields, { moveSubFieldsToTop: true }), which descends into group, tabs, row and collapsible fields but never arrays, and then matches the configured strings against the barefield.name.'submissionData.value'matches nothing.Link to the code path
3.x:packages/ui/src/elements/ListControls/getTextFieldsToBeSearched.ts(whole file — thesearchableFieldNames.has(field.name)match)packages/ui/src/elements/ListControls/index.tsxbuilds the placeholder from its resultpackages/payload/src/utilities/mergeListSearchAndWhere.ts(the search that does work)On
mainthe placeholder is simplified to plain "Search" (ListControls/index.tsx, "Simplified placeholder"), so this only affects 3.x.Reproduction Steps
form-submissionsfrom@payloadcms/plugin-form-builderwithlistSearchableFields: ['submissionData.value']is the real case.)items.value→ the rows filter correctly.Confirmed on 3.86.0 and, by reading the source, 3.89.0.
Expected Behavior
The placeholder names the field(s) actually searched ("Search by Value"), or at least doesn't claim "ID".
Actual Behavior
"Search by ID" while the search matches the array subfield.
Proposed fix
Resolve dotted paths in
getTextFieldsToBeSearched: match against each flattened field's full path (and descendarrayfields), or, asmaindoes, drop the field list from the placeholder.Environment
@payloadcms/plugin-form-builder,@payloadcms/db-postgres, Next.js 16