Input Field Visibility

If you're working with columns in Vizlib Input Form, it can be useful to display (or hide) an input field if a certain condition is met. This article sets out how to use column syntax in an expression to hide or display fields. You can find other examples on working with expressions using column syntax here.

This topic contains the following sections:

Show Field If - Creating an Expression

Show field if (Figure 1) is a setting in Vizlib Input Form which you can find in the input field settings. It's used to display a field only if a condition is met. You can add a condition by entering text in the text box or clicking the function button to open the expression editor.

Figure 5: Show field if

You create the expression by using column syntax. We've included an example here, which displays the field only if a certain value is selected in another field (e.g. a drop-down).

Column('Type')='Other'

So if the value Other is selected in the field Type, the field will be displayed. Otherwise, it will be hidden.

Benefits

The main benefit of using Show field if is increased flexibility when you're working with mandatory field values. If a field is mandatory, it must have a value entered, or the form can't be submitted. If a mandatory field is hidden it will still be part of the input form, but the operation will complete without entering a value.

Layout Wizard - Example

Fields aren't the only item in Vizlib Input Form where you can use apply conditions on being hidden/visible - you can also add expressions to items in the Layout Wizard, using the same column syntax with Items, Groups, and Text. We're going to look at an example where the Contact Information group of input fields are displayed or hidden using a slider (Figure 2).

Figure 2: Show Contact Information

If you open the input form, and go to the Contact Information group, you'll see the Show Group If icon is colored gold, which means an expression has been added (Figure 3).

Figure 3: Show Group If

Click the icon to open the editor and see the expression. To show the group, Has Contact Information needs to be enabled (1=enabled, 0=disabled).

Column([Has Contact Information]) = '1'