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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Error in scripts written in services of a thing

sv
1-Visitor
1-Visitor

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
12-Amethyst
(To:sv)

Hi

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

Regards

Ian

Announcements


Top Tags