POST Json body as variable gives error, but when copy paste the value into the body then it works

Hello !
I am generating a body for a HttpClient activity by combining a number of variables.
The result is the variable TotalBody with the value:

“{‘PropertyValues’: [{‘PropertyDef’: 100,‘TypedValue’: { ‘DataType’: 9, ‘Lookup’: {‘Item’: 93, ‘Version’: -1 } } },{ ‘PropertyDef’: 1273, ‘TypedValue’: { ‘DataType’: 10, ‘Lookups’: [ { ‘Item’: 369499, ‘Version’: -1 } ] } },{‘PropertyDef’: 1214, ‘TypedValue’: { ‘DataType’: 10, ‘Lookups’: [ { ‘Item’: 3, ‘Version’: -1 } ] } },{‘PropertyDef’: 1430, ‘TypedValue’: { ‘DataType’: 1, ‘HasValue’: false, ‘Value’: ‘004011212’ } },{‘PropertyDef’: 1433,‘TypedValue’: {‘DataType’: 5, ‘HasValue’: false, ‘Value’: ‘2019-09-26’}} ]}”

When I put the TotalBody variable in the body argument it returns an error from the application at the Endpoint, saying there is an converting error
image

However, when I write the variable to a text file, then copy past this text file into the Body argument, the json is accepted without error.

Can anyone explain me what the reason can be that the variable is not accepted but the file content is accepted, while both are the same?

I found the issue.
I started and ended the content of the variable with a chr(34) to get a " at the beginning and end.
That was not necessary.
After deleting these it went ok.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.