About this article
Visibility is used in the visibility field of text, image, and group bindings and is almost exclusively used with an IfElse() function for the purpose of hiding/showing or deleting bindings. There are three properties that can be used with visibility, VisibilityType.Visible
, VisibilityType.Hidden
andVisibilityType.Delete
.
|
Prerequisites
|
How to set up a visibility binding?
- Open Templafy task pane in your Office application/start your document creation flow
- Go to the ellipsis menu in the task pane and click on
Dynamics Designer
- Go to the
Element
tab, like shown below:
Example 1
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 |
Example 2
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 |
Example 3
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 |
Example 4
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 |
Comments
0 comments
Article is closed for comments.