Hiding a field dynamically
Trigger type: Simple Action type: Property
This advanced logic hides a form field (i.e., the Child field) when the user inputs "hide" in another form field (i.e., Parent field).
- Open or create a Form file in Studio.
- Add two Text Field components.
- Name one of the text field components as
Parent field, and the other one asChild field. Pay attention to their Property Names, as you use those in your advanced logic. - Go to the Logic tab of the
Child fieldcomponent. - Add a logic and name it
"hide input". - Select the Simple trigger type.
-
From the When the form component dropdown menu, select
Parent field ({parentField_property_name}). -
In the Has the value field, enter
"hide".The above configuration detects if the user input the string
"hide"in the parent field and triggers the action to hide the child field.
-
- Add an action and name it
"hide". - Select the Property action type.
- From the Component Property dropdown menu, select Hidden.
- From the Set State dropdown menu, select True.
- Save the action and the logic.
- Save the component.
At runtime, if the business user inputs "hide" in the parent field, the child field becomes hidden.