How to remove hidden characters when converting from JSON Object to String(extra double quote - ")

Hi All,

Currently Iam facing some issue while creating the JSON body.

I have Deserialize the JSON and converted to string to give it in HTTPRequest Body to call API for POST Method

When I saw the normal execution there is no double quotes present after converting to string and replaced the newline characters, but when I see the execution in debug mode an extra double quote is visible.

I was hoping because of this issue, API is throwing the error({ “httpCode”:“400”, “httpMessage”:“Bad Request”, “moreInformation”:“The body of the request, which was expected to be JSON, was invalid, and could not be decoded. The start of an object { or an array [ was expected.” })*

Can anyone help on this for creating the JSON

Below is JSON string which I have used for deserialize JSON.

“{ ‘comments’: ‘test update without correlation id’,‘work_notes’: 'updated without correlation id }”

once done I have converted to string jsonStr.ToString.Replace(Environment.NewLine(),"") -so that new \r\n characters will be removed

now when I give the result variable in the body it is throwing error

attached screenshot showing the json in debug mode where it is showing with extra double quote and without extra double quote.


Any help in this would be appreciated

Hi @nprasad000

Strange! I’m not sure if you figured it out, but my next step to debug it would be to send the request to a page like webhook.site. It allows you to visually control the output of your POST request.

Typically, the double quote you see in the Locals panel should now affect the output - it is there only because the double quotes for the JSON variables need to be escaped by another double quote on the backend.

This is also why you could have passed this to your Deserialize JSON activity and it would have worked just fine as well:

"{""key"":""value""}"