Skip to main content
16-Pearl
June 10, 2024
Solved

JSON input parameter for service

  • June 10, 2024
  • 1 reply
  • 1187 views

Hello Community,

I am sending jsonData which is my input parameter of the service from my mashup and it goes like this in the picture below.

 

Jamal8548_1-1718016014522.png

I am unable to read it in the service. I know the methods JSON.parse and JSON.stringify but still i am not getting it. I am unable to read the data. why its converting the json in this format.

 

 

I dont why my json is getting converted with double serialization with extra back slashes.

 

 

 

  • Single Serialization: When you serialize a JSON object, it should be converted to a JSON string with necessary escape characters.
  • Double Serialization: If the JSON string is serialized again or if escape characters are added improperly, it results in a string with extra backslashes.
  •  

my json in mashup. its hardcoded i have written. 

Jamal8548_0-1718018450367.png

 

Best answer by MA8731174

Thank you @Bikash_Panda  Actually my company updated the version of the thingworx to 9.3 and here i dont need to do anything. The service is sending right JSON data through parameter. We had before an older version of thingworx and the source of JSON is nothing. Its written hardcoded in the parameter field which i am sending.

1 reply

14-Alexandrite
June 17, 2024

You can probably use an expression to pass in the JSON text and convert that to a JSOn object and the service with input type JSON can take it. What is teh source of the JSOn data from mashup ??

Bikash_Panda_0-1718623931315.png

 

 

MA873117416-PearlAuthorAnswer
16-Pearl
June 17, 2024

Thank you @Bikash_Panda  Actually my company updated the version of the thingworx to 9.3 and here i dont need to do anything. The service is sending right JSON data through parameter. We had before an older version of thingworx and the source of JSON is nothing. Its written hardcoded in the parameter field which i am sending.