Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Show Relation field in list

default discord avatar
snakemastr508last year

Just got started with payload and the multi-tenant example. I love it so far.. One thing I have not yet been able to do is show a relationship in a column.


Is this not possible or undocumented? I have a 1-1 relation and already tried adding the field to defaultColumns without any luck.



Edit: I've added admin.useAsTitle in the related collection but it never shows the field



After some fiddling around, admin.defaultColumns appears to be not working at all in the collection. I keep getting the ID column even if I don't specify it in defaultColumns.



Okay so it appears multiple factors where at play here, 1: I was apparantly not using the 2.x version of payload but a 1.x version. 2: changing defaultColumns multiple times might lead to columns being stored in user preferences and thus do not seem to be updated.



After updating the versions and resetting the preferences it now all seems to work as I intended.

    Star on GitHub

    Star

    Chat on Discord

    Discord

    online

    Can't find what you're looking for?

    Get dedicated engineering support directly from the Payload team.