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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Does DataShape does not support property name having hypen?

Test_user
9-Granite

Does DataShape does not support property name having hypen?

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 ?

 

1 ACCEPTED SOLUTION

Accepted Solutions
DanZ
15-Moonstone
(To:Test_user)

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

 

View solution in original post

3 REPLIES 3

  • We can create data shape name with hyphen "-"

Sathishkumar_C_0-1676358851343.png

 

 

 

 

 

 

 

 

 

 

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.

DanZ
15-Moonstone
(To:Test_user)

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

 

Top Tags