About this article
This article will explain how to adjust the visibility of smart fields based on specific conditions so they can be visible, hidden, or deleted when generating the template.
Prerequisites
|
|
How to adjust the visibility of smart fields?
Often, when building smart templates some elements might require to be visible, hidden, or deleted based on specific conditions. The Visibility
option on the smart field level can be utilized for that purpose and requires the utilization of the binding syntax. Adding a Visibility expression
can be achieved following these steps:
- Created the necessary smart field
- Open the
Advanced
section - Select
Custom visibility
in theVisibility
dropdown - Type in the desired binding in the
Visibility expression
to adjust the smart field visibility
|
|
Visbility Expression
examples
Show or hide the smart field based on the value of a checkbox in the response form
Using the IfElse() function with checkbox to determine visibility of a binding based on the value of Form.Introduction.
Binding | {{IfElse(Form.Introduction, VisibilityType.Visible,VisibilityType.Hidden)}} | |
Input | Checkbox is not checked | Checkbox is checked |
Condition | False | True |
Output | VisibilityType.Hidden | VisibilityType.Visible |
Show or hide the smart field based on the value of a question in the response form
Using the IfElse() function to set visibility of a binding based on the value of Form.Subject
Binding | {{IfElse(Equals(Form.Subject, "Introduction"), VisibilityType.Visible, VisibilityType.Hidden)}} | |
Input | Form.Subject = "Introduction" | Form.Subject = "Product" |
Condition | True | False |
Output | VisibilityType.Visible | VisibilityType.Hidden |
Show or hide the smart field based on the value of a dropdown question in the response form
Using the IfElse() function to set visibility of a binding based on a dropdown.
Binding | {{IfElse(Equals(Form.Confidentiality.Name, "Public"), VisibilityType.Visible, VisibilityType.Hidden)}} | |
Input | Form.Confidentiality.Name = "Public" | Form.Confidentiality.Name = "Confidential" |
Condition | True | False |
Output | VisibilityType.Visible | VisibilityType.Hidden |
Show or delete the smart field based on the value of a dropdown question in the response form
Using the IfElse() function to set visibility of a binding based on a dropdown.
Binding | {{IfElse(Equals(Form.Confidentiality.Name, "Public"), VisibilityType.Visible, VisibilityType.Delete)}} | |
Input | Form.Confidentiality.Name = "Public" | Form.Confidentiality.Name = "Confidential" |
Condition | True | False |
Output | VisibilityType.Visible | VisibilityType.Delete |
Show or hide the smart field based on the value of a dropdown question originating from the user profile
Using the IfElse() function together with Contains() to display or hide some text based on the value of the "Office.Name" originating from the user profile
- If "the Office.Name" is "Copenhagen" or "Berlin", the text should be hidden
- If the "Office.Name" is anything else, the text should be shown
Binding | {{IfElse(Contains("Copenhagen, Berlin", UserProfile.Office.Name), VisibilityType.Hidden, VisibilityType.Visible)}} | ||
Input |
UserProfile.Office.Name = "Berlin" |
UserProfile.Office.Name = "Copenhagen" | UserProfile.Office.Name = "Eindhoven" |
Output | Hidden text | Hidden text | Visible text |
Comments
0 comments
Article is closed for comments.