About this article
This article will explain how to group elements in a document based on specific conditions so they can be visible, hidden, or deleted when generating the template.
Prerequisites
|
|
How to group elements and adjust their visibility in a document?
Often, when building smart documents some elements should be visible, hidden, or deleted based on specific conditions using IfElse statements, the Group
smart field can be utilized for that purpose. Creating a Group
smart field can be achieved following these steps:
- In the Template Designer, navigate to the
Template
tab - Select the elements that should be grouped together
- Click
Add smart field
This step doesn't apply if you are adding the very first smart field in the template - Click on
More
- Click on
Group
- Enter a
Display Name
The display name will be displayed in theTemplate
tab once the smart field has been added. - Select the desired
Visbility
- Always shown: the group will always be displayed without any conditions.
- Custom visibility: the group will be displayed based on the
Visbility expression
appearing below.
- Specify the
Visbility expression
for the group
Visibility expressions are built using the binding syntax along with IfElse statements. - Optionally, perform an additional action on the smart field
Allow updates
: Allow the smart field to be updated after its generation when edited by the user through the document content updater. This option will not be visible if the document content updater is not enabled on the smart template.
- Click
Add to template
- The smart field will be injected into the template and will be displayed in the
Template
tab
- The smart field will be injected into the template and will be displayed in the
|
|
Group
smart field examples
Hide the references in my document based on a checkbox in the response form
Create a Checkbox
question in the response form using " IncludeReferences" as the Reference Name
. Then, select the references in your document and create a Group
smart field using a custom visibility and the following binding syntax in the Visbility expression
: {{IfElse(Form.IncludeReferences, VisibilityType.Visible, VisibilityType.Hidden)}}
- If the checkbox is checked, the references will be visible in the document
- If the checkbox isn't checked, the references will be hidden in the document
Hide the reference in my document based if the reference question in the response form is empty
Create a Text
question in the response form using " YourRef" as the Reference Name
. Then, create a Form responses
smart field where the answer to " YourRef" question should be inserted into the document. Finally, create a Group
smart field using a custom visibility and the following binding syntax in the Visbility expression
:
{{IfElse(Equals(Form.YourRef, " "), VisibilityType.Visible, VisibilityType.Hidden)}}
- If the question is filled by the user, the reference will be visible in the document
- If the question isn't filled by the user, the reference will be hidden in the document
Related articles
Comments
0 comments
Article is closed for comments.