About this article
To keep track of your documents when saving them to a document management system (DMS) like SharePoint, you can use the following options in Dynamics Designer to save the required metadata:
- Custom XML Value (Dynamics Metadata): Always use this option (e.g. for textbox form fields), unless the column in SharePoint is of type 'Managed Metadata' (term sets) or 'Date and Time'.
- Custom XML Managed Metadata (Dynamics Metadata): Use this option only when the column in SharePoint is of type 'Managed Metadata' (term sets).
- Custom XML DateTime Value (Dynamics Metadata): Use this option only when the column in SharePoint is of type 'Date and Time'.
This article explains how this can be configured.
Sections in this article:
- How to configure Custom XML Value
- How to configure Custom XML Managed Metadata (term sets)
- How to configure Custom XML DateTime Value
Prerequisites
|
How to configure Custom XML Value
In the example below a Word template is configured and the metadata is saved to SharePoint.
Example 1
- Create a document in SharePoint (or upload a document):
- Close the document.
- Select the saved document and open the details pane. Then add random values to all columns you want to use. Do not leave them blank:
|
- Download the document and open it.
- Open Dynamics Designer, then on the Settings tab enable
Enable as template
(and optionally enableEnable Document Content Updater
): - Next, create form fields 'Title', 'OrderID', 'Description' and 'Category':
|
- On the Document tab select
Custom XML Value (Dynamics Metadata)
and click the+
button: - On the Developer tab select
XML Mapping Pane
. In the field Custom XML Part selecthttp://schemas.microsoft.com/office/2006/metadata/properties
.
When you select this namespace, an element named properties with a child element named documentManagement appears. Expand documentManagement to show all available fields (column names) from SharePoint:
|
Note that the column 'Order ID' from SharePoint is shown as Custom XML Part 'Order_x0020_ID'. The name 'Order ID' is the display name in SharePoint, while 'Order_x0020_ID' is the internal name (this is the name you need to use for your template). In SharePoint the internal name can be retrieved by opening the properties of a column. The URL will show the internal name:
- The form contains these fields:
- Namespace: enter
http://schemas.microsoft.com/office/2006/metadata/properties
. - Path: enter
/p:properties/documentManagement/*[local-name()="<field>"]
, where <field> is the name of the field you want to use. In this example the result is /p:properties/documentManagement/*[local-name()="Order_x0020_ID"]. - Binding: enter the form field you want to use, in this case {{Form.OrderID}}.
|
- The result looks like this:
We also want to save the Title of the document to SharePoint. This is a special field (note that it is not available as Custom XML Part in the image from step 8). Instead of usingCustom XML Value (Dynamics Metadata)
, you have to selectDocument Property (Dynamics Metadata)
.
- On the Document tab select
Document Property (Dynamics Metadata)
and click the+
button. The form contains these fields:
- Property Name: select the document property field you want to use, in this case
title
. - Property Value: enter the form field you want to use, in this case {{Form.Title}}.
- Save your template (name it e.g. 'MyTemplate') and upload it to Templafy Admin.
- Open the template in Composer and create a document:
- Save the document to SharePoint. The metadata is shown in the columns and the details pane.
The result looks like this:
|
How to configure Custom XML Managed Metadata (term sets)
A special column of type Managed Metadata can be created in SharePoint. It enables users to select terms from a specific term set. If you want to use this column in your template then you need to follow the steps below.
Example 2
In this example the template from example 1 is expanded with custom xml that saves the value to a managed metadata column in SharePoint.
|
- In SharePoint create a new column (in this example 'Snacks') and select
Managed Metadata
as the type of information:
|
- In the section Term Set Settings you can use a managed term set or create your own term set. In this example we select
Customize your term set
. ClickCreate Term
to create one or more terms:
- The result looks like this:
- For Templafy you need to know the Unique Identifier for each term created in the previous step. Go to the Site Settings page and open
Term store management
:
- In the Term Store Management Tool, when you select a term, the details show the Unique Identifier:
|
- In Admin create a data source that contains all terms and their corresponding unique identifiers. You can use the default 'Name' column and e.g. a column named 'UniqueIdentifier':
- Next, in Admin download the template ('MyTemplate') created in example 1, and open it in Dynamics Designer. Create a dropdown form field (e.g. 'Snack') and link it to the data source from the previous step:
- Save the template.
|
- Upload the template to SharePoint (to the library where you have created the new column).
- In SharePoint select the saved template and open the details pane. Then add a random value to the new field 'Snacks' (and to all other columns you want to use):
- Download the template and open it.
- On the Developer tab select
XML Mapping Pane
. In the field Custom XML Part selecthttp://schemas.microsoft.com/office/2006/metadata/properties
. You see all available fields (column names) from SharePoint created earlier, and a new field named (in this example) 'k48e728b471d4ab68c80ce6895fa8dd5' with child elements named 'Terms', 'TermInfo', 'TermName' and 'TermId'.
In the XML Mapping pane managed metadata fields are not shown with their display name, but with their unique identifier. The identifier shown in this example represents the field (column) 'Snacks' you have created:
|
- On the Developer tab select
XML Mapping Pane
. In the field Custom XML Part selecthttp://schemas.microsoft.com/office/2006/metadata/properties
:
- Create a
Custom XML Managed Metadata (Dynamics Metadata)
field with these values (see image above):
- Namespace: enter
http://schemas.microsoft.com/office/2006/metadata/properties
. - Path: enter
/p:properties/documentManagement/<field>
, where <field> is the name of the field you want to use. In this example the result is: /p:properties/documentManagement/k48e728b471d4ab68c80ce6895fa8dd5. - Term Id: enter the form field you want to use for the Term Id, in this case {{Form.Snack.UniqueIdentifier}}.
- Term Name: enter the form field you want to use for the Term Name, in this case {{Form.Snack.Name}}.
|
- Save your template and upload it to Templafy Admin.
- Open the template in Composer and create a document:
- Save the document to SharePoint. The (managed) metadata is shown in the columns and the details pane. The result looks like this:
How to configure Custom XML DateTime Value
A column of type Date and Time can be created in SharePoint. It enables users to select a date from a calendar. If you want to use this column in your template then you need to follow the steps below.
Example 3
In this example the template from example 2 is expanded with custom xml that saves the value to a date and time column in SharePoint.
|
- In SharePoint create a new column (in this example 'Date') and select
Date and Time
as the type of information:
- In Admin download the template created in example 2, and open it in Dynamics Designer. Create a date form field (e.g. 'Date').
- Save the template.
|
- Upload the template to SharePoint (to the library where you have created the new column).
- In SharePoint select the saved template and open the details pane. Then add a random value to the new field 'Date' (select any date from the calendar).
- Download the template and open it.
- On the Developer tab select
XML Mapping Pane
. In the field Custom XML Part selecthttp://schemas.microsoft.com/office/2006/metadata/properties
. You see all available fields (column names) from SharePoint created earlier, and a new field named (in this example) 'Date':
- Create a
Custom XML DateTime Value (Dynamics Metadata)
field with these values (see image above):
- Binding: enter the form field you want to use, in this case {{Form.Date}}.
- Namespace: enter
http://schemas.microsoft.com/office/2006/metadata/properties
. - Path: enter
/p:properties/documentManagement/*[local-name()="<field>"]
, where <field> is the name of the field you want to use. In this example the result is: /p:properties/documentManagement/*[local-name()="Date"].
- Save your template and upload it to Templafy Admin.
- Open the template in Composer and create a document (select a date).
- Save the document to SharePoint. The date is shown in the column and the details pane. The result looks like this:
Comments
0 comments
Article is closed for comments.