Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Sub-fields in collections #2491

Open
IzMichael opened this issue May 17, 2023 · 1 comment
Open

Feature Request: Sub-fields in collections #2491

IzMichael opened this issue May 17, 2023 · 1 comment

Comments

@IzMichael
Copy link

IzMichael commented May 17, 2023

I'd love to have some way to have a group of fields be part of a parent field, as shown below.

{
  // default fields
  "created": "",
  "modified": "",
  "id": "",

  // sub-field
  "something_new": {
    "sub_field_a": "",
    "sub_field_b": ""
  }
}

This would help with organisation and naming of fields.
I know I can just do a JSON type field, but then I don't get the form inputs in the admin UI, and I don't get the schema validation and relation features.

@ktunprasert
Copy link

For what it's worth, you could listen to the records event hook with the new JS extension and modify the response before it is sent. This would end up being quite gnarly to maintain as you would have to detect the record property per collection and group them accordingly in a huge switch statement.
https://pocketbase.io/docs/js-event-hooks/#onrecordviewrequest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants