Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Word merge sporadically inserts raw HTML content in the document



A small fraction of users sporadically observe distorted Word documents, where raw HTML is merged into the template instead of the expected content. The resulting Word document contains “The operation completed successfully, but returned no content” phrases.

This example shows only a small fragment of the inserted HTML content, which starts with opening <HTML> tag and ends with closing </HTML> tag. If you copy all of it, paste into a file, and load the file into any browser, the following picture will get rendered:

Error Messages

Not Applicable

Steps to Reproduce

1. Embed field { pega:reference .my_property} into a Word template.
2. Make sure property value on Clipboard is blank at runtime.

Note: Since the issue is highly sporadic, following these steps will rarely result in its reproduction.

Root Cause

The following describes the immediate cause of the issue.

When Word macrocode merges field of type {pega:reference .my_property } it invokes activity GetPropertyValue over HTTP to retrieve value of property .my_property.
The first step of activity checks the property value and if it is blank “” replaces it with “ “ space character. This is done to prevent the engine from executing activity ActivityStatusContentNoHandler that returns "Status Good" HTML stream.
In a vast majority of cases on most deployment sites this works as intended, but in this scenario the space character is treated as blank and HTML stream is returned, causing distortions is the Word document layout.


Perform the following local-change:

Replace the { pega:reference .my_property } type fields in the Word template with fields of type { pega:insert corrinline=my_corr_rule }.

The my_corr_rule includes the property .my_property serving as a “wrapper” for that property. This is done for every property that ends up equal to blank at runtime.

Always prefer to use { pega:insert corrinline=my_corr_rule } instead of { pega:insert corr=my_corr_rule } in Word documents because { pega:insert corr=my_corr_rule } will include an extra line after the content is merged.


Published November 8, 2016 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us