Sometimes you need to alter fields conditionally. The
conditions property in a form field allows for altering the schema.
This is an example of a schema that shows a different set of options based on a value of another field.
conditions property should be set to an array containing objects with keys
when is a function called with
formContext wrapped in an object. If this function returns a truthy value, the
then object will be merged into the field object. Otherwise, the
otherwise object will be merged.
You don't have to specify both
otherwise, one is sufficient.