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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

What is the infotable format in javascript?

luweicheng
1-Newbie

What is the infotable format in javascript?

What is the infotable format in javascript? I don't know how to input the infotable when I use the function "SetPropertyValues".

1 ACCEPTED SOLUTION

Accepted Solutions
billrei
5-Regular Member
(To:luweicheng)

Here is a sample of setting a property of a thing using SetPropertyValues.

var myInfoTable = { dataShape: { fieldDefinitions : {} }, rows: [] };

myInfoTable.dataShape.fieldDefinitions["safety"] = {

     name: "safety",

     baseType: "BOOLEAN"

};

myInfoTable.rows=[{safety:true}];

Things["AquaponicsThing"].SetPropertyValues({

  values: myInfoTable

});

This can be done much more easily within a service by just doing:

Things["AquaponicsThing"].safety = true;


View solution in original post

2 REPLIES 2
billrei
5-Regular Member
(To:luweicheng)

Here is a sample of setting a property of a thing using SetPropertyValues.

var myInfoTable = { dataShape: { fieldDefinitions : {} }, rows: [] };

myInfoTable.dataShape.fieldDefinitions["safety"] = {

     name: "safety",

     baseType: "BOOLEAN"

};

myInfoTable.rows=[{safety:true}];

Things["AquaponicsThing"].SetPropertyValues({

  values: myInfoTable

});

This can be done much more easily within a service by just doing:

Things["AquaponicsThing"].safety = true;


Thanks!

Top Tags