Templafy Hive template configuration is not backwards compatible with documents created in Templafy One.
This means that Hive forms cannot be used to update documents originally created in Templafy One.
For clients migrating to Templafy Hive, this creates a challenge — particularly when they still need to work with and update documents that were previously created in Templafy One.
The purpose of this feature is to enable users to convert Templafy One documents into their equivalent Templafy Hive templates.
Please note:
Conversion is only possible when a corresponding Hive template exists for the original Templafy One document.
Each template requires specific and detailed configuration to support conversion.
The feature will:
Inject Templafy form- and transformation configuration into non-Templafy documents.
Enable Templafy to update custom document properties within the converted document.
Configuration
CMD
<Cmd case="BaseExtensions:update-element-data-from-one-to-hive" path=""/>
path
The path to the relevant One to Hive map configuration file. Uses Content\BaseExtensions as the root folder.
One to Hive map
{
"BindingsMapping": {
"Form.One": "{{Form.Hive}}",
"Form.One.Sub": "{{Form.Hive.Sub}}"
},
"VisibilityMapping": {
"Form.One": "Form.Hive",
"Form.One.Sub": "Form.Hive.Sub"
},
"TemplafyTemplateConfiguration": {},
"TemplafyFormConfiguration": {}
}BindingsMapping and VisibilityMapping are both produced as part of a script which is run by the delivery team when converting a Templafy One tenant to a Hive tenant. These need to be attained from the project manager in charge of the migration.
TemplafyTemplateConfiguration the entire extracted TemplafyTemplateConfiguration JSON object as described below here.
TemplafyFormConfiguration the entire extracted TemplafyFormConfiguration JSON object as described below here.
Extracting Templafy Hive Configuration
The contents of the TemplafyTemplateConfiguration and TemplafyFormConfiguration objects in the One to Hive map need to be based on documents created using the corresponding Hive template. To do this manually, create a the required document (actual form values are irrelevant) and either extract the content from the custom XML manually, OR use one of the following scripts to do so.
PPT_ExtractRelevantContentFilesAndFolders.ps1
WD_ExtractRelevantContentFilesAndFolders.ps1
NOTE that the scripts will also extract the relevant parts from all Word or PowerPoint files in a folder if selected.
Understanding Templafy configuration
On creation of a document, Templafy injects two separate JSON objects within custom xml parts based on the configuration within the template. Note that the structure of these objects is broadly similar across both Templafy One and Hive, but the specific syntax used in each differs.
TemplafyFormConfiguration
{
"formFields": [],
"formDataEntries": []
}formFields contains an array of encrypted version of any value added to a Templafy form.
formDataEntries contains an array of all forms and any associated configuration for that form. This is essentially the result of any configuration added to the template via the user profile or a response form.
TemplafyTemplateConfiguration
{
"elementsMetadata": [
{
"type": "richTextContentControl",
"id": "123-456",
"elementConfiguration": {
"binding": "",
"visibility": "",
"type": "text"
}
}
],
"transformationConfigurations": [
{
"propertyName": "",
"propertyValue": "",
"disableUpdates": false,
"type": "customDocumentProperty"
}
],
"templateName": "",
"templateDescription": "",
"enableDocumentContentUpdater": true,
"version": ""
}elementsMetadata is an array where each object represents the configuration of a visible binding within a document or presentation. These are essentially the result of the smart fields added to the document by the template admin.
type equal to richTextContentControl in Word and shape in PowerPoint.
id equates to the tag value in the word document content control or PowerPoint shape, i.e. {"templafy":{"id":"123-456"}}. This is essentially the link between the config and the output.
elementConfiguration holds the configuration specific to the binding. Note that this can vary significantly depending on the config applied by the admin, most significantly because of the type and visibility settings applied.
transformationConfigurations holds the configuration specific to non binding content, custom document properties and page setup for example.
templateName the name of the template as defined by the admin.
templateDescription the name of the template as defined by the admin.
enableDocumentContentUpdater set to true if the document content updater has been enabled for the template, false if it hasn't.
version equates to the version of Templafy dynamics selected for the template. Note that for Hive this needs to be set to 2.0.
Functionality overview
On creation of a document, Templafy injects two separate JSON objects within custom xml parts based on the configuration within the template. This is true in both One and Hive. The functionality replaces the One configuration with an equivalent Hive configuration.
The functionality performs a number of tasks.
- It replaces the entire
TemplafyFormConfigurationobject with the version found in the One to Hive map. - It replaces the entire
TemplafyTemplateConfigurationobject with the version found in the One to Hive map. - It converts all elements in the
elementsMetadataarray to a Hive equivalent configuration based on an inbuilt rule set. - It replaces all existing Form and visibility bindings with the versions found in the One to Hive map. In the map, the key name for the binding represents the One binding, the key value represents the Hive Binding to convert to.
Functional Limitations
- The
BindingsMappingandVisibilityMappingcan only contain one instance of each binding. This means that there may be instances in some documents where the same binding is treated differently in different parts of the document. This cannot be supported. - Theme application is not supported
- Page Layout is not supported.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article