cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Create data shape and Infotable of given JSON type

Highlighted
Not applicable

How to Create data shape and Infotable of given JSON type

"EmployeeDetails": [

        {

            "EmpID ": "101",

            "status": "Active",

         

            "mobiles": [

                "9554781498",

                "9554789555"

            ],

            "Address": [

                "Address1",

                "Address2"

            ]

        },

{

            "EmpID ": "102",

            "status": "Active",

         

            "mobiles": [

                "9954781478",

                "9854789535"

            ],

            "Address": [

                "Address4",

                "Address5"

            ]

        }]

Tags (2)
6 REPLIES 6

Re: How to Create data shape and Infotable of given JSON type

Hi Raj, have you already checked the available extension for this Parsely Advanced Parsing Extension available on ThingWorx Marketplace. It essentially parses the JSON (and some other formats) to Infotable.

Re: How to Create data shape and Infotable of given JSON type

Actually i have to build an extension(In Java) having services which return type should be infotable, But I have Json of above type, now please tell me how do i  create datashape of given JSON so that i can create Infotable and return from Extension - service.

Re: How to Create data shape and Infotable of given JSON type

Since Thingworx can 'natively' work with JSON why do you need to build the conversion into your extension? You can do it with a Service leveraging the fact that the JSON will be treated as an object.

Re: How to Create data shape and Infotable of given JSON type

My Requirement is to display service output on the grid, And grid can only be configured with Infotable.

Is there any way to directly map jsonObject to grid?

do you mean by

String json_string = EntityUtils.toString(httpResponse.getEntity());

infoTable.fromJSON(new JSONObject(json_string));

Re: How to Create data shape and Infotable of given JSON type

Does this have to be in a Resource?

Just a service in a Thing should do.

use the createinfotablefromdatashape to create an empty table

then step through the json object

create row objects and then add those to the empty table.

Re: How to Create data shape and Infotable of given JSON type

Just to add to what Pai already noted, it appears like this has been already discussed under separate thread Converting JSON into Infotable