Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
var result = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape({
dataShapeName: "TestDataShape"
});
var newEntry=new Object();
for(var i=0;i<result1.length;i++){
newEntry.first-data = result1[i].first-data;
.
.
.
result.AddRow(newEntry);
}
Does DataShape does not support property name having hypen? ie.newEntry.first-data
and my second question is does result1[i].first-data;is not supported in thingworx? result1[i].first-data is coming from json file
Can you help me out over here ?
Solved! Go to Solution.
That has nothing to do with Thingworx, but you need to use the bracket notation to access such a property:
const firstData = result1[i]['first-data']
What you trying with... newEntry.first-data = result1[i].first-data; ?
Can I have sample date of result1 here? Is it a JSON or INFOTABLE? What is data?
Thank you.
result1 has data in JSON format.
That has nothing to do with Thingworx, but you need to use the bracket notation to access such a property:
const firstData = result1[i]['first-data']