About this article
To keep track of your documents when saving them to a document management system (DMS) like SharePoint, you can use Custom XML Value (Dynamics Metadata) in Designer to save the required metadata.
This article explains how this can be configured.
Sections in this article:
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:
|
Managed metadata (term sets)
A special column named 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 a custom xml value 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 Value with these values (see image above):
- Namespace: enter
http://schemas.microsoft.com/office/2006/metadata/properties
. - Path: enter
/p:properties/documentManagement/*[local-name()="<field>"]/pc:Terms/pc:TermInfo/pc:TermId
, where <field> is the name of the field you want to use.
In this example the result is /p:properties/documentManagement/*[local-name()="k48e728b471d4ab68c80ce6895fa8dd5"]/pc:Terms/pc:TermInfo/pc:TermId. - Binding: enter the form field you want to use, in this case {{Form.Snack.UniqueIdentifier}}.
|
- 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:
Comments
0 comments
Article is closed for comments.