Is it possible to fetch additional schema based on conditional values?

Hello,

Is it possible to add conditionals where based on certain values, a remote source would be appended to the schema.

For example, selecting a state would trigger a fetch request to the api to get a list of landmarks for that state?

Actually got it working, created a custom hoc on to wrap my renderer in where i’m checking for additional values in the change handler that are being passed up from the custom renderer and fetching remote data based on those values. I wasn’t updating the generated UIschema with the new fields.

so now when i get my results, i merge the schemas, generate a new defaultUiSchema and dispatch updateCore:

ctx.dispatch(updateCore(ctx.core.data, newSchema, newUiSchema, {}));
handleChange(path, value);

and things seem to be working as expected.

If theres a better/easier solution, i’d love to see it.

Thanks!

Hi @mvoloz, this approach makes sense when you modify the schema quite a bit. In case you only want to fetch enum data we usually handle this within a custom renderer without changing the schema or UI Schema.