Form Schema stored on API with select fields each with it's on options API URL #928
Unanswered
gabriel-kohen-by
asked this question in
Need help
Replies: 1 comment 2 replies
-
Hi. You can use an action mapper to adjust the schema at runtime. https://data-driven-forms.org/mappers/action-mapper#heading-actionmapper Or create a wrapper around the select component. I can create some examples tomorrow. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi All,
First of all I want to share my excitement as I just ran into this library to drive metadata driven forms.
We'd like to be able to store all form definitions(metadata including all the schema supported by this library) on backend API services. So this schema will be loaded at runtime rather than having it as code in build time.
In addition we want the schema to be able to support select(dropdown) fields that can get each their possible options from a definition of a URL for that field metadata.
The approach we thought of taking was thinking to serialize to:
loadOption
only support functions and functions are invalid JSON value, AFAIK, we can transform a specific function name which we will implement into an actual function in the used schema. That function could read an extra prop we can have with that field. For instanceloadOptionsUrl
. Using the value of loadOptionsUrl for that field it will load the possible options from individual APIs.I'd love to hear if you think we're taking the right approach or there is a better way to achieve this.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions