About Convert JSON file to Infotable
I follow the document: https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS179012 to convert JSON file to Infotable, so I:
1. Create the Datashape based on the JSON key and value.
2. Create the service to getJSON file, and the code is:
var params = {
proxyScheme: undefined /* STRING */,
headers: undefined /* JSON */,
ignoreSSLErrors: true /* BOOLEAN */,
useNTLM: undefined /* BOOLEAN */,
workstation: undefined /* STRING */,
useProxy: undefined /* BOOLEAN */,
withCookies: undefined /* BOOLEAN */,
proxyHost: undefined /* STRING */,
url:"http://servername/rest/sql/list/site/",
timeout: undefined /* NUMBER */,
proxyPort: undefined /* INTEGER */,
password: undefined /* STRING */,
domain: undefined /* STRING */,
username: undefined /* STRING */
};
// result: JSON
var data = Resources["ContentLoaderFunctions"].GetJSON(params);
var params = {
infoTableName: undefined /* STRING */,
dataShapeName: "TestJSON" /* DATASHAPENAME */
};
// result: INFOTABLE
var jsonTable = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);
for(var i=0;i<data.length;i++)
{
jsonTable.AddRow({id:data.array.id, area:data.array.area, group:data.array.group, WS_name:data.array.WS_name, state:data.array.state, child:data.array.child});
}
//}
result = jsonTable;
3. After save and test, the result is an empty infotable.
Can anyone help?

