Articles in this section

What is the binding syntax used in smart templates?

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

  • Library and at least one Dynamics modules enabled.
  • Templafy Desktop and Office VSTO add-in installed on the PC.
  • Admin/owner access to the Templafy tenant and Space owner access.

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: 

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

  1. In Word or PowerPoint, open Template Designer.
  2. Navigate to the Template tab.
  3. Drill down the user profile smart field and select the desired field.
    TemplateSelectUserProfileField.png
  4. Expand Advanced.
  5. Click Edit binding.
  6. The binding syntax to be used will be displayed in the Binding field:
    • FormFieldName 'Office' is marked red.
    • DataSourceColumn 'Name' is marked green.
      TemplateUserProfileField2colors.png

  Note

Getting the user profile binding syntax from the Template Designer will provide the full binding including the DataSourceColumnnecessary for dropdowns fields.

Inside the Admin Center

  1. Navigate to the Admin Center of your Templafy tenant.
  2. In the User section, select the User Profile tab.
  3. Click Edit form.
  4. Hover the necessary user profile field.
    UserProfileFieldEdit.png
  5. Click Edit.
  6. The FormFieldName will be displayed in the Name field.
    UserProfileFieldEditNamefield.png

  Note

Keep in mind that if the form field is a dropdown, one must replace DataSourceColumn by specifying the column of the data source that should be used. This can be looked up by navigating to the correct data source in the Resources tab of the Admin Center and inspecting the data source columns.

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

  1. In Word, or PowerPoint, open Template Designer.
  2. Navigate to the Template tab.
  3. Drill down the form responses smart field and select the desired field.
    TemplateSelectFormField.png
  4. Expand Advanced.
  5. Click Edit binding.
  6. The binding syntax to be used will be displayed in the Binding field:
    • FormFieldName 'Country' is marked red.
    • DataSourceColumn 'Name ' is marked green.
      FormFieldEditNamefield.png

  Note

The response form binding syntax in the Template tab of the Template Designer contains the full path to the data, including the DataSourceColumn part of the path.

Inside Template Designer through the Form tab

  1. In Word, PowerPoint, or Excel, open Template Designer.
  2. Navigate to the Form tab.
  3. Click on the ellipsis menu of the desired question and click Edit.
  4. Expand Advanced.
  5. The FormFieldName will be displayed in the Reference name field.
    FormFieldEditReferenceName.png

  Note

Keep in mind that if the question is a dropdown or a data connector, one must replace DataSourceColumn by specifying the column of the data source or the external data source that should be used. This can be looked up by navigating to the correct data source or external data source in the Resources tab of the Admin Center and inspecting the data source columns.

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?

  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.

AdvancedDocumentSettings.png

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.

VisibilityExample2.png

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.

ExampleFunction.png

Word PowerPoint templates Outlook admin_role
Was this article helpful?
0 out of 1 found this helpful

Comments

0 comments

Article is closed for comments.