Articles in this section

How to set the document name of a template

About this article

This article will explain what the document name setting is and provide examples of how it can be used with the binding syntax in smart templates.  

 

Prerequisites

 

 

What is the document name setting?

The document name sets the name for the document when a document is created with the Templafy WebApp and then downloaded. If the document name isn't set, the name of the template will be used by default.
The document name can be set statically or dynamically by using the
binding syntax

 

 
  • The document name sets the name for a document created with the WebApp. When you (also) want to set the name for a document created with Word, then you need to use the document property 'Title'.
  • The document name setting is only supported with files that are stored in Template Libraries (Documents, Presentations and Spreadsheets).
  • Assets (Text elements, Email elements, Slides and Slide elements) will inherit from the setting upon insertion.
  • If the document name should be a combination of multiple fields the StringJoin() function can be used.

 

 

How to set the document name in a smart template?

When building template settings and properties the Document Name setting can be used to set the document name for a document created from a smart template.
To set the Document Name follow the steps below: 

  1. In the Template Designer open the Advanced tab.

  2. Click + Add property.

  3. Select Document Name in the Type dropdown.

  4. Enter the required binding in the field Document Name.
     
  5. Click Add to document.

Document_name.gif

 

 

 

Document name examples

 

Example 1

Using the Document Name setting to always set the name of the document to 'Memo.docx'.

Binding Memo

 

Example 2

Using the Document Name setting to set the name of the document based on the value of the 'Subject' question originating from the response form.

Binding {{Form.Subject}}
Input Subject = "Invitation" Subject = "Memo"
Output "Invitation.docx" "Memo.docx"

 

Example 3

Using the Document Name setting together with the StringJoin() function to set the document name combining the text 'Memo', the value of the 'Subject' question originating from the response form and the 'Name' field originating from the user profile, separated by a space.

Binding {{StringJoin(" ", "Memo", Form.Subject, UserProfile.Name)}}
Input

Subject = "Invitation"

Name = "Jane Doe"

Subject = "Party"

Name = "John Doe"

Output "Memo Invitation Jane Doe.docx"  "Memo Party John Doe.docx"

 

 
  • If you use "-" or "_" as separator (e.g. {{StringJoin("_", "Memo", Form.Subject, UserProfile.Name)}} then the output will be e.g. "Memo_Party_John Doe.docx".
    This works fine when you only create documents using the Templafy WebApp (which uses the Document Name).
    If you also want to create documents using Word then you need to configure the document property 'Title', but when using "-" or "_" in the document property, the name will be truncated (this is a Microsoft limitation) when the document is saved.
    So "Memo_Party_John Doe.docx" becomes "Memo.docx"! Of course you want the name of the document to be the same, whether the document is created with the WebApp or Word, so it's best not to use "-" or "_" as separator for Document Name as well.
  • If you want to set the title for a document created from Word, when choosing the option Open in Word and then save the document, then use the document property 'Title'.

 

Example 4

Using the Document Name setting with HostSystem binding to set the document name with the 'Subject' value from an external source via an App connector.

Binding {{HostSystem.Subject)}}
Input Subject = "Invitation" Subject = "Memo"
Output "Invitation.docx" "Memo.docx"

 

Related articles

 

 

templates bindings document property document name title smart fields
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.