When using the Word Doc from Template Smart Service with a runtime template, some substitution keys (placeholders surrounded by three pound symbols, e.g. ###section###) are successfully recognized in the setup tab but are not replaced in the output document.
###section###
Microsoft Word is automatically formatting the text which creates extra XML tags in the template. If the XML formatting of the template and the runtime template do not match, then the substitution key will not be replaced.
This issue can occur even if Microsoft Word has not reported any spelling or grammar errors.
This issue has been reported to the Appian Product Team. The reference number for this issue is AN-125621.
To ensure that neither the base template nor the runtime template have malformed XML tags, perform the following steps for all templates:
To determine if a template document has malformed XML, save the template docx as XML in Microsoft Word and investigate the XML. Properly formed XML will have contiguous substitution keys including the pound symbol delimiters. For example, the XML for substitution key "###sectionNumber###" may look like this:
"###sectionNumber###"
<w:r><w:t>###sectionNumber###</w:t></w:r>
If the XML is malformed, the substitution key will be interrupted with extra XML tabs:
<w:r><w:t>###section</w:t></w:r><w:r w:rsidR="00CA73EC"><w:t>Num</w:t></w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/><w:r w:rsidR="00CA73EC"><w:t>ber</w:t></w:r><w:r><w:t>###</w:t></w:r>
For more information, review the Word Doc From Template documentation.
This article applies to all versions of Appian.
Last Reviewed: March 2019