Articles in this section

How to set a document property in the metadata of a template

About this article

This article explains what the document properties are and provide examples of how they can be used with the binding syntax in smart templates.  

 

Prerequisites

 

 

What are document properties? 

Document properties are data that sit on top of the document, they are also known as metadata. Document properties are often used for archiving purposes in Document Management Systems (DMS) such as SharePoint. These values can be set statically using plain text or dynamically using the binding syntax

 

Standard document properties available

Document

  • Category sets the Categories property in the template
  • Creator sets the Author property in the template
  • Description sets the Comments property in the template
  • Keywords sets the Tags property in the template
  • Subject sets the Subject property in the template
  • Title sets the Title property in the template
  • Manager sets the Manager property in the template
  • Company sets the Company property in the template
  • Hyperlink Base sets the Hyperlink Base property in the template
  • Status sets the Status property in the template

 

 
  • The document property Title sets the name for a document created with Word*.
    When you (also) want to set the name for a document created with the Templafy WebApp then you need to use the Document Name.
  • If the property that should be set in the template isn't displayed in the document properties, a custom document property can be created.
  • Document properties are 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 document properties from the Document, Presentation or Spreadsheet upon insertion.

    * Set the name with document property Title is not supported with PowerPoint (this is a Microsoft limitation).
    ** Only when a text element is opened directly from the WebApp (as if it were a document) then a configured document property will work.

 

How to set a document property in a smart template

When building the template settings and properties, the Document Property can be used to set the standard properties for the smart template. To set the Document Property follow the steps below:

  1. In the Template Designer, navigate to the Advanced tab.

  2. Click + Add property.

  3. Select Document Property in the Type dropdown.

  4. Select the desired property in the Property Name dropdown, for example Creator.

  5. Enter a static value or the required binding in Property Value, for example {{UserProfile.Name}}.
     
  6. Click Add to document.

Document_property.gif

 

 

 

 

Document properties examples

 

Example 1

Using Document Property to always use 'MyCompany' (without quotes) as the Company property.

Binding MyCompany
Output Company property = "MyCompany"

 

Example 2

Using the Document Property to set the Subject property of the template based on the value of thet 'Subject' question originating from the response form.

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

 

Example 3

Using the Document Property to set the Category property of the template based on the value of the 'Category' dropdown question originating from the response form.

Binding {{Form.Category.Name}}
Input "Contract" "Proposal"
Output Category property = "Contract" Category property = "Proposal"

 

Example 4

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

Subject = "Invitation"

Name = "Jane Doe"

Subject = "Party"

Name = "John Doe"

Output Title property = "Memo Invitation Jane Doe" Title property = "Memo Party John Doe"

 

 
  • If you use "-" or "_" as separator (e.g. {{StringJoin("_", "Memo", Form.Subject, UserProfile.Name)}} then the output will not be e.g. "Memo_Party_John Doe.docx" but "Memo.docx" as the name will be truncated by Word (this is a Microsoft limitation). So it's best not to use "-" or "_" as separator.
  • If you (also) want to set the title for a document created with the Templafy WebApp then use the Document Name.

 

In Template Designer the binding {{StringJoin(" ", "Memo", Form.Subject, UserProfile.Name)}} is used:

dp_propertynametitle.png

 

When a document is created then in the Properties form and 'Save As' dialog the result looks like this:

dp_saveastitle.png

 

 
  • The default behavior of the 'Save As' dialog in Word:
    - If the 'Title' field contains a value (like in the screenshot above) then that name
    is suggested as file name.
    - If the 'Title' field is empty then (part of) the first line of text in the document is used.
    - If the document is empty then e.g. 'Doc1.docx' is suggested (when the document is 'Document1').

 

 

Related articles

 

 

metadata document templates document property document name title property
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.