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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Error in scripts written in services of a thing

sv
1-Newbie
1-Newbie

Error in scripts written in services of a thing

Hi

I have a service which have some scripts, but when i execute it i get this error

"Wrapped org.json.JSONException: JSONObject["dataShape"] not found. Cause: JSONObject["dataShape"] not found."

I cant find any solution for this in the community.

The script i used is

var params={

      headers :{'Content-Type':'application/json','Accept':'application/json','appkey':'*******'},

      url:'http://************/Thingworx/Things/Logistics/Properties/test',

};

var Json=Resources["ContentLoaderFunctions"].GetJSON(params);

var Infotable=Resources["InfoTableFunctions"].FromJSON({json:Json});

var testString=Infotable.test;

var result=testString.split("|");

Things["Logistics"].Device_id=result[0];

Things["Logistics"].Flag=result[1];

Things["Logistics"].Theft_flag=result[2];

Things["Logistics"].Temperature=result[3];

Things["Logistics"].Humidity=result[4];

Things["Logistics"].Battery_volt=result[5];

Things["Logistics"].Data=result[6];

1 REPLY 1
ibanham
1-Newbie
(To:sv)

Hi

The "FromJSON" method isn't as friendly as it sounds.... see FromJSON() usage

Regards

Ian

Top Tags