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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Resources["ContentLoaderFunctions"].PostJSON Content JSON Format?

rahulsoni6391
1-Newbie

Resources["ContentLoaderFunctions"].PostJSON Content JSON Format?

Hi,


I have tried PostJSON by content in service and as json input.

It works on one line of Json. E.g. {"name": "Quality", "description": "Quality dataset"}. I am able to create a dataset.

    

But not for these lines of JSON. E.g.

[

{

"categories": [

"Pharmacy Claims History"

],

"dataType": "BOOLEAN",

"description": "Y2_RxClass_MM_Sympathomimetics",

"displayOnly": false,

"fieldName": "Rx Class: MM Sympathomimetics [Y2]",

"lever": false,

"objective": false

},

{

"categories": [

"Health Risk Attributes"

],

"dataType": "ORDEREDSTRING",

"description": "PrevYear1_SMOKING",

"displayOnly": false,

"fieldName": "SMOKING [PrevYear1]",

"lever": false,

"objective": false,

"values": [

"NA",

"Unknown",

"Low",

"Medium",

"High"

]

}

]


But this is format for configuring the datasets by post json from Postman for TWX ML. Why I'm unable to post this line to create the configuration for the created dataset.


Is there any special JSON content format for TWX to post JSON?


Is there any workaround?

Thanks and regards,

Rahul Soni

2 REPLIES 2

Rahul,

I don't have a direct answer to your PostJSON question (just an idea: try to send JSONObjects, not JSONArrays - wrap the JSONArray) but I wanted to point out that there is a ThingWorx Machine Learning Extension (incorrectly called Coldlight Neuron Analytics - I'll ask to fix that) in the Marketplace that you can use for the basic interactions with TWX ML. It has services to create, configure and load datasets based on native TWX elements (mainly InfoTables).

Cheers, moritz

Moritz,

Thank you very much for the prompt reply.

Wrapping the JSONArray and posting it by PostJSON, It didn't help.

I have already worked with Thingworx Machine Learning Extension. It has issues on configuring the dataset and uploading the data. Already got confirmation on these bugs from TS. So trying to create two services for them.

Thanks and regards,

Rahul Soni

Top Tags