How do I customize the User relationship dropdown in collections?

default discord avatar
supaku
4 weeks ago
1

I have a collection where I added a relationship field to user. The dropdown shows the user's full name only, and I would like to modify that dropdown to instead be "Full Name ( email )". Is there a supported path to make this change?



For now, I've just updated the

admin.useAsTitle

to

email

. It'd be nice if I could use multiple fields in a specific format:

'{ name } - { email }'
  • default discord avatar
    brianjm
    3 weeks ago

    The most common way to do this is to create a hidden field that contains the

    useAsTitle

    value you want to display, and populate it with a hook (

    beforeRead

    or

    afterChange

    ).

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

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

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