#Why can't i access relationship fields from my admin UI list view and defaultColumns?

10 messages · Page 1 of 1 (latest)

near belfry
#

Please check the screenshots. I am trying to access user's first name from my customers collection which is stored in Users collections. Customers have data related to them while Users collection hold general information like first name, email etc.

indigo sigil
#

You'll need to create a virtual, root-level field that mirrors the data from that nested field, that you'll be able to use for useAsTitle.

near belfry
#

So I need to recreate virtual fields in my Customers collection for all the fields in my Users collection? What's the point of relationships then? This is very inconvenient.

fiery veldt
#

For the field that you want to use as title

near belfry
#

I want to display firstName, lastName, avatar, and a bunch of other fields from my Users collection in my Customers collection view in the admin panel. I can never access to customer.user.firstName, or avatar fields?

subtle adder
#

You can only use top-level fields in your config as a useAsTitle. As others have mentioned, you could use a "compound" field which gets populated via some hook like beforeChange. If you want to show this much data on every entry in your list view, then you should use a custom cell component for this compound field.

fiery veldt
near belfry
#

Thank you. Does the custom component need to be client or server?

fiery veldt
#

Can be both