Skip to main content
1-Visitor
March 23, 2020
Solved

Unable to convert complex JSON object into infotable using parsley extension

  • March 23, 2020
  • 2 replies
  • 930 views

Hi,

 

I am using ParseJSON method for Parsley extension. 

It gives me one row properly inserted into infotable if we run this method on simple json like:-

 

{

                "input1":"{\"name\":\"MichaelJordan\",\"age\":\"38\",\"address\":\"Noida\" }"

}

 

But it fails to insert any row when we run this method on complex JSON:-

{

                "input2":"{\"name\":\"TestUser123\",\"age\":\"54\",\"address\":\"{\"street\":\"main street\",\"city\":\"Ggn\",\"pin\":\"202021\"}\"}"

}

and gives blank row.

 

Could somebody help me how to insert this json into infotable as well?

 

Thanks in advance.

Best answer by PaiChung

Have you thought of just creating your own parsing code.

JSON is recognized as an object in Thingworx and you can use es 4 / es 6

So if you know the structure you can fairly easily create your own parsing code.

 

2 replies

PaiChung22-Sapphire IAnswer
22-Sapphire I
March 23, 2020

Have you thought of just creating your own parsing code.

JSON is recognized as an object in Thingworx and you can use es 4 / es 6

So if you know the structure you can fairly easily create your own parsing code.

 

Support
April 3, 2020

Hi @ranjank.

 

If you found the previous response to be an acceptable solution, please mark it as the Accepted Solution for the benefit of others on the community.

 

Regards.

 

--Sharon