Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
I'm trying to create an infotable from a JSON array that is in a logged property. The problem is that one of the elements in the array has a dash in the name ("arc-time"). I cannot change the element but can't get it to come through. The following code gives me an error: "missing name after .operator". Any ideas?
var obj= me.ErrorHistory;
var params = {
infoTableName: "InfoTable",
dataShapeName : "ErrorHistory_Shape"
};
var infotabletest = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);
for(var i=0; i<obj.array.length; i++)
{
infotabletest.AddRow({"id":obj.array.id,"type":obj.array.class,"arctime":obj.array.["arc-time"]});
}
var result= infotabletest;
Solved! Go to Solution.
When you get a field value with ["arc-time"] no "." should be written, then your instruction should be:
infotabletest.AddRow({"id":obj.array.id,"type":obj.array.class,"arctime":obj.array["arc-time"]});
What is your Thingworx platform version?
I will recreate, and if a bug is confirmed, submit a jira.
When you get a field value with ["arc-time"] no "." should be written, then your instruction should be:
infotabletest.AddRow({"id":obj.array.id,"type":obj.array.class,"arctime":obj.array["arc-time"]});
That worked Carles!. I knew it was something small. Thanks!