Troubleshooting Merge Fields Mappings in Generate Document Action

Applies to:

SharePoint Online and SharePoint On-Premises (NITRO Workflows and NITRO Custom Actions)

Symptoms

  1. Data is not merging into the Microsoft Word document generated using ‘Microsoft Office API’.
  2. While adding ‘Merge Fields Mappings’ in generate document action, the ‘Merge Field’ drop-down is empty.

Cause

“Preserve formatting during updates” option is enabled for merge fields in the selected Microsoft Word template file in Generate Document action.

Resolution

Uncheck “Preserve formatting during updates” option for all the merge fields in Microsoft Word template file as shown below:

  1. Navigate to the library where Microsoft Word template file is uploaded -> Download the Word template → Edit the document.
  2. Right click the merge field → Select ‘Edit Field…’ -> Uncheck the option ‘Preserve formatting during updates’ → Click OK.

3. Repeat #2. for all the merge fields -> Save the document.

4. Upload the Word document to the same library and replace it with the existing document.

5. Edit the configured ‘Generate Document’ action → Select the template file edited in #2. and #3. from ‘Template File’ drop down → Click ‘Add Column Mapping’ button → ‘Merge Field’ drop down will display all the available merge fields → Map the merge fields as needed -> Click Ok -> Publish the NITRO Custom action/ NITRO Workflow.