Skip to main content
1-Visitor
July 19, 2015
Solved

What is the infotable format in javascript?

  • July 19, 2015
  • 1 reply
  • 2797 views

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

Best answer by billrei

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;


1 reply

billrei12-AmethystAnswer
12-Amethyst
July 19, 2015

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;


1-Visitor
July 20, 2015

Thanks!