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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Getting error in QueryNamedPropertyHistory infotable

bgupta-2
10-Marble

Getting error in QueryNamedPropertyHistory infotable

Dear Team,

I am using QueryNamedPropertyHistory service to bring infotables. But when I am adding this infotable value to my custom infotable I am not getting value of field Pump_Speed_SE-101 but getting value of timestamp

row={Pump_Speed_SE-101=com.thingworx.types.primitives.NumberPrimitive@4e5f36ca, timestamp=com.thingworx.types.primitives.DatetimePrimitive@42cd2ca6}

var resultInfotable = Things[ThingName].QueryNamedPropertyHistory(params);

var tableLength = resultInfotable.rows.length;

for (var x = 0; x < tableLength; x++) {

    var row = resultInfotable.rows;

    var newEntry = new Object();

    newEntry.timeseries = row.timestamp;           // DATETIME

    newEntry.propertyName = row.propertyName;           // here propertyName = Pump_Speed_SE-101

    infotableToshow.AddRow(newEntry);

}

var result = infotableToshow;



Output ==>


timeseries                              propertyName

2017-11-08 19:15:27.000

2017-11-08 19:10:27.000

2017-11-08 19:05:27.000

2017-11-08 19:00:27.000

2017-11-08 18:55:27.000

2017-11-08 18:50:27.000

2017-11-08 18:45:27.000

2017-11-08 18:40:27.000

2017-11-08 11:05:26.000

Thanks


2 REPLIES 2

Just a dumb answer, newEntry.propertyName = row.propertyName; maybe should be newEntry.propertyName = row["Pump_Speed_SE-101"];

Thanks

Announcements


Top Tags