AnsweredAssumed Answered

get all questionable samples using filter_expression

Question asked by arikyudin222 on Aug 28, 2019
Latest reply on Sep 12, 2019 by Dan Fishman

Hi Guys,

I'm using PIWebAPI 2018 in my project, and I'm wondering how do I use the filterExpression on the streams/{webId}/recorded API to get all "Questionable=true" samples or all samples that their value is not numeric, but an object/JSON....

Considering that this are the samples:

{   "Links": {},   "Items": [     {       "Timestamp": "2019-08-28T08:44:02.8824615Z",       "Value": {         "Name": "Set to Bad",         "Value": 247,         "IsSystem": true       },       "UnitsAbbreviation": "",       "Good": false,       "Questionable": false,       "Substituted": false,       "Annotated": false     },     {       "Timestamp": "2019-08-28T08:44:03.8824615Z",       "Value": {         "Name": "Set to Bad",         "Value": 247,         "IsSystem": true       },       "UnitsAbbreviation": "",       "Good": false,       "Questionable": false,       "Substituted": false,       "Annotated": false     },     {       "Timestamp": "2019-08-28T08:44:04.8824615Z",       "Value": {         "Name": "Set to Bad",         "Value": 247,         "IsSystem": true       },       "UnitsAbbreviation": "",       "Good": false,       "Questionable": false,       "Substituted": false,       "Annotated": false     } ] }

I've tried the following query:

https://10.0.1.28/piwebapi/streams/I1DPo-1ZAJh2tUWnH9PxCZlqIQ6n0AAA/recorded?startTime=-3h&limit=1000&filterExpression=%22Questionable=false%22

And this is the response I get:

{   "Links": {},   "Items": [     {       "Timestamp": "2019-08-28T08:44:59.0414841Z",       "Value": null,       "UnitsAbbreviation": "",       "Good": false,       "Questionable": false,       "Substituted": false,       "Annotated": false,       "Errors": [         {           "FieldName": "Value",           "Message": [             "[-15011] PIvalue Type is Not Numeric"           ]         }       ]     }   ],   "UnitsAbbreviation": "" }

Outcomes