Custom id field is not recognized as such when placed inside of a row/collapsible

default discord avatar
dr_mint10 months ago

Hi, I'm not sure if this would be considered a bug or a documentation issue.

To create a custom id, we can explicitly declare an


field with type text or number (

). However, in my experience, this field also needs to be at the root of the collection's fields list. So, if the


field is declared within a row or collapsible, it no longer is recognized as a custom id field, and just a normal field that happen to be named


. In the DB, there will be a


field (the actual id), and


, just a normal text/number field.

I can understand the custom id cannot be within a group, a block, an array, or (named) tabs, as these fields can change the data structure in DB. However in the docs, the row and collapsible fields are said to be "presentational-only and only affects the Admin panel". The way I see it, either it is an intented behavior, in which case there could be a note about this here

, or it is not and I can open a bug report.

Custom id field is not recognized as such when placed inside of a row/collapsible

  • discord user avatar
    10 months ago

    I think this should be possible, I can see in the code that custom id fields are not retrieved recursively. We just need to build a function to hoist fields out of rows/collapsibles/unnamed tabs. @jmikrut are you on board with this being an issue? Or would you like to limit it to a doc update?

  • discord user avatar
    10 months ago

    i'd say this should be a feature request added to our roadmap

    and we can update the docs in the meantime to call this out

Star on GitHub


Chat on Discord



Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.