I don’t think we can nest group fields in another group field.
hey
i just did UI
i spent the 100 hours overthe last 7 days working on our payload setup
okay so
can we use default values
for blocks
that returns an object
i have some dynamic recursive stuff going on
it doesnt work well so i had to not use group
hmm
dont think u can
add default value for grooups
yea u have to do default value at each level
individually
u cant pass an object to a group
thats weak
how do we add default value to ui type
i eventuallu figured it out thanks
Don't use groups is my advice
The generated UI is not as nice
I don't remember if filtering has improved now
Hey
@789268703774375986, you actually can do this! Here's an example:
fields: [
{
name: 'topGroup',
label: 'Top Group',
type: 'group',
fields: [
{
name: 'field1',
label: 'Field 1',
type: 'text',
},
{
name: 'nestedGroup',
label: 'Nested Group',
type: 'group',
fields: [
{
name: 'field2',
label: 'Field 2',
type: 'text',
},
],
},
],
},
]
UI field types don't have values, they are just for adding in custom React components. If you want to store value with a custom component, start with a field type that stores value such as
text
or
number
, whatever the type of data you want to save, and then use
admin.components
to customize it.
Always try to reload the express server first 😛
Hi sorry for following up on an old post, were there any specific reasons or disadvantages to using groups? Will it complicate my config to nest fields within groups?
Don't use groups is my advice
isn't good advice in my opinion. I mean the use cases of Payload vary so much...
You do "pay a price" for using them. For example: Payload doesn't allow to display nested fields in the list view atm (V2, not sure about V3).
You can still create a custom list view or add the column yourself, it's just a little more work.
Filtering works in v3 beta, but lisview does not yet.
Star
Discord
online
Get dedicated engineering support directly from the Payload team.