I have a form that has a few sections that are visible only when certain previous dropdown selections were made. As my form is now, someone could make a selection to make a section appear, fill out fields in the section, then go back and change the dropdown selection and the values stay in the fields that are now no longer visible. These values could mess with my automations downstream, so they need to be null if they are not visible. How can I ensure that fields retain a null value if they are not visible?

1 Answer 1


I'm a developer with Cognito Forms. In order to make sure that a field retains a null value even when changed from visible to not visible, what you can do is add an if/then statement to the default value of the field that you would like to clear the value from.

In order to do this, you'll select the field that you want to clear the value from when hidden. In the 'Default Value' found in the field settings, you'll create an if/then statement that is referencing the choice field and the selection within the choice field that its appearance is dependent upon. For example:

=if (ChoiceField="Choice") then null else null

Now, when someone makes a selection other than "Choice" in ChoiceField, the conditional field will disappear, and the value will be cleared.

  • This worked out for me, but I ended up modifying it. The field in question actually appears if Choices 1 or 2 are NOT chosen, but Choices 3, 4, 5, or 6 ARE chosen. Using the logic you provided yielded a null value if the ChoiceField changed at all, even to a value that allowed the field to become visible was chosen. That made it look awkward, so the logic I endedup with looked like this (the EIN field is the one that is visible based on EntityType chosen): =if (EntityType="Individual/Sole Proprietor") then null else if (EntityType="Single-Member LLC") then null else EIN
    – Timo
    Feb 28, 2018 at 1:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.