Articles in this section

How to set the document name of a template

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

  Prerequisites

  • Library and at least one Dynamics module enabled.
  • Templafy Desktop and Office VSTO add-in installed.
  • Space owner access to the Templafy tenant.

What is the document name setting?

The document name sets the name for the document when a document is created with the Templafy Web App 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 (using a plain text value) or dynamically by using the binding syntax.

  Important

  • The Document Name sets the name for a document created with the Web App. 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 templates that are stored in the Libraries (Documents, Presentations, and Spreadsheets Libraries).
  • Assets (Text elements, Email elements, Slides, and Slide elements Libraries) inherit document properties from the document, presentation or spreadsheet 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 the template settings and properties, the Document Name setting can be used to set the document name for a document created from a smart template, following the steps below:

  1. In Template Designer, open the Advanced tab.
  2. Click + Add property.
  3. In the Type field select Document Name.
  4. In Document Name enter a static value (plain text without quotes) or a binding like {{Form.Subject}}.
  5. Click Add to document:
    advancedtabdocumentname.png
  6. The field is added to the list with Document settings:
    documentsettingsdocumentname.png

Document name examples

Example 1

Using Document Name with the value 'Memo' (without quotes) to always set the name of the document to 'Memo.docx'.

Binding Output
Memo "Memo.docx"

Example 2

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

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

Example 3

Using Document Name together with the StringJoin() function to set the document name by 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 Input Output
{{StringJoin(" ", "Memo", Form.Subject, UserProfile.Name)}}

Subject = "Invitation"

Name = "Jane Doe"

Title property = "Memo Invitation Jane Doe"
 

Subject = "Party"

Name = "John Doe"

Title property = "Memo Party John Doe"

  Important

  • 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 Web App (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 Web App or Word, so it's best not to use "-" or "_" as separator for Document Name either.
  • 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 Document Name with a HostSystem binding to set the document name with the 'Subject' value from an external source via an App connector.

Binding Input Output
{{HostSystem.Subject}} Subject = "Invitation" "Invitation.docx"
  Subject = "Memo" "Memo.docx"
functions custom document property blank form responses gating question form configuration is broken a malformed uri was found in the document tech_role
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.