1 Reply Latest reply on Jul 1, 2016 3:23 AM by ianban RSS
    sv Apprentice

    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];