Dynamic fields support for multitentancy case #13987
vitakili
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Feature Request: Dynamic Templates & Tenant-Aware Fields
Summary
In multi-tenant projects it’s common to work with a single collection (e.g.
Items
) but require different sets of fields depending on the tenant or a selected template. Right now this is only possible by combining JSON fields, custom admin components, and hooks. It works, but it adds a lot of boilerplate and is not very ergonomic.Use Case
Items
collection across multiple tenants.area
,rooms
,map location
mileage
,fuel type
,year
cuisine
,opening hours
gte
,lte
,equals
) works without extra hooks.Current Workarounds
json
field (e.g.dynamicFields
) with a custom admin component that renders inputs dynamically.item-templates
collection to store field definitions.beforeValidate
hooks.indexedFields
object inbeforeChange
so they can be queried.While this approach works, it requires maintaining schema logic, validation, UI, and indexing in several places.
Proposal
Template-based schema extension
Link a document to a template that defines which fields apply. Payload would render those fields automatically in the admin panel.
Tenant-aware conditional fields
Allow field visibility and requirements to depend on tenant or template without writing custom components.
Native indexed dynamic fields
Values stored as dynamic fields should automatically be indexed to support filtering in REST and GraphQL queries.
Admin UI improvements
Support optional icons, grouping, and help text for template-defined fields to make dynamic UIs more user-friendly.
Benefits
Beta Was this translation helpful? Give feedback.
All reactions