Let us consider that we have 2 properties Property1 and Property2 in Thing Thing1 which we want to update using UpdatePropertyValues service.

  1. In our service we will use a system defined DataShape NamedVTQ which has following field definitions:
  2. In Thing1 create a custom service like following:
    • var params1 = {
           infoTableName : "InfoTable",
           dataShapeName : "NamedVTQ"
      };
      
      // CreateInfoTableFromDataShape(infoTableName:STRING("InfoTable"), dataShapeName:STRING):INFOTABLE(NamedVTQ)
      var InputInfoTable = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params1);
      var now = new Date();
      
      // Thing1 entry object
      var newEntry = new Object();
      newEntry.time = now; // DATETIME - isPrimaryKey = true
      newEntry.quality = undefined; // STRING
      
      newEntry.name = "Property1"; // STRING
      newEntry.value = "Value1"; // STRING
      InputInfoTable.AddRow(newEntry);
      
      newEntry.name = "Property2"; // STRING
      newEntry.value = "Value2"; // STRING
      InputInfoTable.AddRow(newEntry);
      
      var params2 = {
           values: InputInfoTable /* INFOTABLE */
      
      };
      me.UpdatePropertyValues(params2);