Azure Logic Apps - Word Online connector - Populate Word template trims whitespaces

Bert Kamphuis 1 Reputation point
2023-05-04T08:41:28.58+00:00

Hi,

We created a Logic Apps flow to populate a Word template file with JSON data from a HTTP request.

Everything is working well, except for JSON values which have leading or subsequent whitespaces or whitespace(s) only as the value. In these cases somehow the Word Online (Business) Connector trims the whitespace unwanted.

Example

  • JSON
{"InvoiceTotalQuantityPrefix": " uur"}

Please note the whitespace in the JSON before the text value 'uur'

  • Content control in template

User's image

  • Result
    User's image

Note that the space is missing in the generated document.

The strange thing is that if we open the generated document in Word Online (which is saved in Sharepoint online), the whitespace is visible. Once we open the document in Word Desktop or save it to a PDF file, the whitespace is gone.
Result in Word Online:
PopulateWordTemplateWordOnlineResult

Result in PDF:
ResultPDF

We have no clue at all why this occurs.

Is there a solution to not let whitespaces be trimmed automatically? We do want to keep whitespaces explicitly set in the input JSON file.

Regards,

Bert

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,112 questions
0 comments No comments
{count} votes