You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a schema, you can use the condition property to show or hide a field based on the value of another field.
For example, in this playground example I am entering info about iPads and iPads may or may not have cellular capability.
The schema has a required checkbox field named hasCellular and a non-required textbox field named phoneNumber, which is displayed only if this iPad has cellular capabilities:
In the generated UI, I go ahead and configure an iPad that has cellular service:
I tick the hasCellular checkbox, and the phoneNumber field is displayed.
I enter the value 0123456789 in the phoneNumber textbox.
Then I realize my mistake: this iPad does not have cellular capability! So I uncheck hasCellular and the the field phoneNumber is hidden. When I click the Submit button, the json returned contains the phoneNumber field.
While the returned json is valid per the schema, it makes no sense.
My expectation would be that if the field phoneNumber is not displayed based on the condition property, then there be no entry for it in the submitted json.
Note: This behavior would not apply to a field that is marked as hidden in the schema, not displayed because the section it is in is collapsed (not expanded), or any other reason not related to condition.
I would like one of the following:
When the condition property returns false, the field or object is set back to being undefined
I can specify that when the condition property returns false, that the field or object is set back to being undefined
Maybe by changing the schema to something like this:
I just realized that it could create issues with required and default:
Field is required. This would make no sense because to enter a value the user is required to check the checkbox. So the checkbox is no longer a yes/no option. It would be a forced "yes".
Field has default. When the field is hidden the value is reset to the default value. This effectively resets the field or object back to its original state when the form was displayed.
Update: If bug #38 is fixed, then the issue with default is no longer relevant, as the default value is not returned in the form json.
justjam2013
changed the title
Feature request: Clear field when hidden by condition
⚙️ Feature request: Clear field when hidden by conditionMay 26, 2025
Uh oh!
There was an error while loading. Please reload this page.
Describe the requested feature:
When creating a schema, you can use the
condition
property to show or hide a field based on the value of another field.For example, in this playground example I am entering info about iPads and iPads may or may not have cellular capability.
The schema has a required checkbox field named
hasCellular
and a non-required textbox field namedphoneNumber
, which is displayed only if this iPad has cellular capabilities:In the generated UI, I go ahead and configure an iPad that has cellular service:
hasCellular
checkbox, and thephoneNumber
field is displayed.0123456789
in thephoneNumber
textbox.Then I realize my mistake: this iPad does not have cellular capability! So I uncheck
hasCellular
and the the fieldphoneNumber
is hidden. When I click the Submit button, the json returned contains thephoneNumber
field.What would I like to happen:
While the returned json is valid per the schema, it makes no sense.
My expectation would be that if the field
phoneNumber
is not displayed based on thecondition
property, then there be no entry for it in the submitted json.Note: This behavior would not apply to a field that is marked as
hidden
in the schema, not displayed because the section it is in is collapsed (not expanded), or any other reason not related tocondition
.I would like one of the following:
condition
property returns false, the field or object is set back to being undefinedcondition
property returns false, that the field or object is set back to being undefinedMaybe by changing the schema to something like this:
So when I uncheck the
hasCellular
checkbox, the submitted json looks like this:The text was updated successfully, but these errors were encountered: