Articles in this section

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

This article explains what document properties are and provide examples of how they 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 are document properties?

Document properties is data about a document, also known as metadata.

Metadata is information about a document that is not part of the main content. It helps describe its content and characteristics. In e.g. a Word document, metadata can include details like the title, author, creation date and last modified date. This information helps to organize, search for, and manage documents more effectively in Document Management Systems (DMS) such as SharePoint.

If you need more fields than offered in document properties, you can add custom document property fields.

  Important

  • Document properties are 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.
    • In case of Text elements, a document property only works when the text element is opened directly from the Web App (as if it were a document).

Standard document properties

The following standard document property fields are available in Template Designer:

advancedtabdocumentproperties.png

The fields can be used to fill the document property fields in Office (the example below shows Word):

documentpropertieswithvalues.png

  Note

The field names in the first column above do not always match the name in the Properties form. For example Tags (marked red) is called Keywords (marked green) in the Properties form.

The names of the document property fields in Template Designer are (in most cases) the same as used in Office:

  • Category: sets the Categories/Category property in the document.
  • Creator: sets the Author property in the document ('John Johnson' in the image above).
  • Description: sets the Comments property in the document.
  • Keywords: sets the Tags/Keywords property in the document.
  • Subject: sets the Subject property in the document.
  • Title: sets the Title property in the document.
  • Manager: sets the Manager property in the document ('Jane Doe' in the image above).
  • Company: sets the Company property in the document.
  • Hyperlink Base: sets the Hyperlink Base property in the document.
  • Status: sets the Status property in the document.

  Important

  • 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 Web App then you need to use Document Name.
  • Setting the document name with document property Title is not supported with PowerPoint (this is a Microsoft limitation).

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 document properties for the 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 Property.
  4. In Property Name select the desired property name, for example Company.
  5. In Property value enter a static value (plain text without quotes) or a binding like {{UserProfile.Office.Name}}.
  6. Click Add to document:
    advancedtabdocumentproperty.png

Document property examples

Example 1

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

Binding Output
MyCompany Company property = "MyCompany"

Example 2

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

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

Example 3

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

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

Example 4

Using 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 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 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 Web App then use Document Name.

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

advancedtabdocumentpropertytitle.png

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

documentpropertysaveastitle.png

  Note

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').
functions custom document property custom xml datetime value form responses hide form field gibberish 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.