`listSearchableFields` for relationship picker?

default discord avatar
7 months ago

Does anyone know of a way that you can search by a field other than the title when selecting a record from a relationship field select dropdown?

In my example, I want to associate related "Fixtures" to one another, but I'd like the ability to search not only by the


, but also by the


field. I can make this happen on the collection list page (by way of


in my collection declaration, but this doesn't seem to carry over to the select dropdown.

Any ideas?

  • discord user avatar
    Payload Team
    7 months ago

    Currently that is not possible. This would be a great feature to add.

    I would make it so that the relationship field has an


    property called


    or similar that would take the path of the thing to search on.

    Then the relationship field input could use that instead of the


    field when the config option is present.

    One thing that complexifies this a bit is that having multiple


    for different collection would need their own search fields. That leaves a lot of room for error, so maybe better to have it on the collection as a sibling to


    . I'm thinking out loud.

    The next step is to create a Github discussion for a new feature request where these details are figured out and somebody can go on to code it.

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!


Connect with the Payload Community on Discord



Can't find what you're looking for?

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