Now you’ve started creating your Smart Form, you’ll need to edit Elements to make the Smart Form more sophisticated. Visibility conditions allow you to dynamically determine which Elements should be displayed to the end user. Once you have dragged and dropped an Element onto the Section Elements Manager, you can use the edit function to add and amend the properties of the Element.


To learn more about how to edit an element in the Designer, please see this article for more information: How to Edit Elements - General




How Do Visibility Conditions Work?


Visibility conditions are used to make Elements visible or hidden based on the state of a previous Element. The values for visibility conditions are:

  1. True – meaning the Element is hidden.
  2. False – meaning the Element is displayed (not hidden).


By default, all Elements have the value of false and are therefore visible and displayed in the app.




Example 


In this scenario, a Boolean Element (Does the above store contact need updating?) should display the contact fields below (Text Elements) if the Boolean Element is set to True (Yes).



1. Navigate to the Visibility tab of each of the Text Elements' Edit window and use this formula: BooleanName == false.



The Boolean Element is by default set to No (False). So, when the Boolean is set to No (False) the visibility condition is true. As mentioned above, when the visibility condition is true, elements will be hidden. Therefore, when the Boolean Element is set to No, the contact fields will be hidden and when Yes is selected, the contact fields will be displayed.


When bad syntax is used in formula formation, an error message will appear under the formula box in red indicating where syntax needs to be fixed. You can still save the bad syntax but make sure you correct it before publishing!



3. Save your changes.