This article explains what the binding syntax is within smart templates and how to use it. The binding syntax is especially used when creating complex smart fields or when setting up template settings and properties.
Prerequisites
|
What is the binding syntax?
The binding syntax is utilized inside smart templates in order to create dynamic relations between the template and the data that should be injected inside it or to manipulate the visibility of elements.
Sometimes when working with smart fields, the response form, or template settings and properties, one will need to manipulate the binding syntax to achieve the expected result. Once the basic syntax is in place, one can add functions, conditions, and operators to create more complex use cases.
Binding syntax for the user profile
In order to link to a form field originating from the user profile, one must use:
- For textbox, checkbox, combo box, and date fields:
{{UserProfile.FormFieldName}}
. - For dropdowns:
{{UserProfile.FormFieldName.DataSourceColumnName}}
.
It is necessary to specify the column of the data source that should be used in the binding.
In the above syntax, FormFieldName
and DataSourceColumn
must be replaced by the actual path to the data.
Where to find the syntax for the user profile?
The FormFieldName
of a user profile can be found inside Template Designer in Word and PowerPoint or through the Admin Center.
Inside Template Designer
- In Word or PowerPoint, open Template Designer.
- Navigate to the Template tab.
- Drill down the user profile smart field and select the desired field.
- Expand Advanced.
- Click Edit binding.
- The binding syntax to be used will be displayed in the Binding field:
-
FormFieldName
'Office' is marked red. -
DataSourceColumn
'Name' is marked green.
-
NoteGetting the user profile binding syntax from the Template Designer will provide the full binding including the |
Inside the Admin Center
- Navigate to the Admin Center of your Templafy tenant.
- In the User section, select the User Profile tab.
- Click Edit form.
- Hover the necessary user profile field.
- Click Edit.
- The
FormFieldName
will be displayed in the Name field.
NoteKeep in mind that if the form field is a dropdown, one must replace |
Binding syntax for response form
In order to link to a form field originating from the response form, one must use:
- For text, checkbox, flexible dropdown, number, and date questions:
{{Form.FormFieldName}}
. - For dropdowns and Data connector questions:
{{Form.FormFieldName.DataSourceColumnName}}
.
It is necessary to specify the column of the data source that should be used in the binding.
In the above syntax, FormFieldName
and DataSourceColumn
must be replaced by the actual path to the data.
Where to find the form field name for the response form?
The FormFieldName
of a response form can be found inside the Template Designer through the Template tab in Word and PowerPoint, or through the Form tab in Word, PowerPoint, and Excel.
Inside Template Designer through the Template tab
- In Word, or PowerPoint, open Template Designer.
- Navigate to the Template tab.
- Drill down the form responses smart field and select the desired field.
- Expand Advanced.
- Click Edit binding.
- The binding syntax to be used will be displayed in the Binding field:
-
FormFieldName
'Country' is marked red. -
DataSourceColumn
'Name ' is marked green.
-
NoteThe response form binding syntax in the Template tab of the Template Designer contains the full path to the data, including the |
Inside Template Designer through the Form tab
- In Word, PowerPoint, or Excel, open Template Designer.
- Navigate to the Form tab.
- Click on the ellipsis menu of the desired question and click Edit.
- Expand Advanced.
- The
FormFieldName
will be displayed in the Reference name field.
NoteKeep in mind that if the question is a dropdown or a data connector, one must replace |
Binding syntax for an App Connector
HostSystem values are relevant when the document creation flow starts from another system through an App connector, such as Salesforce, SharePoint, Document Creation Services 1.1, and others, or through the Document Generation API.
In order to link to external data originating from an App connector or an API request, one must use:
- The data is in the first layer:
{{HostSystem.DataName}}
. - The data is in the third layer:
{{HostSystem.DataNameLayer1.DataNameLayer2.DataNameLayer3}}
.
In the above syntax, DataName
must be replaced by the actual path to the data.
Where to find the DataName?
- How to find the data available from the Salesforce App Connector?
- How to find the data available from the SharePoint App Connector?
- How to enable Document Creation Services 1.1 App Connector?
Note
|
How to use the binding syntax
The binding syntax can be used in many different ways to serve several needs. For example, the binding syntax can be used to set up template settings and properties, set custom visibility for elements, on smart fields to create advanced and complex dynamics, and more.
Example Template settings and properties
When creating template settings and properties for smart templates, the binding syntax will be required to achieve the expected result.
Example of adding the 'Subject' response form as document name and the user profile 'Name' as creator.
Example Custom visibility
Sometimes, when building smart templates, it may be necessary to adjust the visibility of a single element or a group of elements based on one or more conditions.
Example of adjusting the visibility of the smart field 'Subject' originating from the response form: Iif the subject isn't filled by the user, hide the smart field in the template, otherwise show the user input.
Example advanced smart fields
On occasions, it might also be necessary to create more advanced smart fields and utilize different functions, conditions, or operators together to achieve the expected result.
Example of editing the 'Name' smart field to enforce the user name to be fully capitalized when inserted in the smart template.
Comments
Article is closed for comments.