Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
This may be a basic question. But why does this fail ?, What is the right way to update ?
var values = Things["TestDataTable"].CreateValues(); values.Id = Id; //INTEGER [Primary Key] values.Name = "Name"+Id; //STRING var params = { maxItems: undefined /* NUMBER */, values: values /* INFOTABLE*/, query: undefined /* QUERY */, source: undefined /* STRING */, tags: undefined /* TAGS */ }; // result: INFOTABLE var table = Things["TestDataTable"].QueryDataTableEntries(params); if(table.length>1) { var row = table[0]; var values = Things["TestDataTable"].CreateValues(); values.Attendance = 11; //NUMBER values.RollNum = row.RollNum; //STRING [Primary Key] values.Percent = 11; //INTEGER values.Id = row.Id; //INTEGER [Primary Key] values.Name = row.Name; //STRING var params = { sourceType: undefined /* STRING */, values: values /* INFOTABLE*/, location: undefined /* LOCATION */, source: undefined /* STRING */, tags: undefined /* TAGS */ }; // no return Things["TestDataTable"].UpdateDataTableEntries(params); }