const Tag: CollectionConfig = {
slug: 'tags',
fields: [
{
name: 'product',
type: 'relationship',
relationTo: 'products',
required: true,
},
{
name: 'date_given_out',
type: 'date',
required: true,
},
],
};
export default TagWith this code, the dropdown will display the Id of my products. I want
product.nameto be displayed instead. I couldn't find in the documentation where to set this.
if you want the name to be used across payload to identify documents in that collection, you can set
admin.useAsTitlein its collection config:
https://payloadcms.com/docs/configuration/collections#admin-optionsThanks!
you're very welcome!
How you've solved it? I'm facing the same issue.
From what I understand, in the collection’s CollectionConfig that you want the specific field to be displayed instead of the
id, try adding the following:
admin: {
useAsTitle: 'title',
},Star
Discord
online
Get dedicated engineering support directly from the Payload team.