Skip to main content
10-Marble
November 15, 2017
Question

Getting error in QueryNamedPropertyHistory infotable

  • November 15, 2017
  • 1 reply
  • 1201 views

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


    1 reply

    1-Visitor
    November 15, 2017

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

    bgupta-210-MarbleAuthor
    10-Marble
    November 16, 2017

    Thanks