PI Web API NameFilter usage

HI ALL,

 

I would like to filter results on my streams interpolateattimes query created following below link

 

https://docs.aveva.com/bundle/pi-web-api-reference/page/help/controllers/stream/actions/getinterpolatedattimes.html

 

Below is sample response from query. Now, I want to filter results where Good is True. In the above document it is mentioned that we could use FilterExpression using '.' notation but I am unable to achieve it. can you provide exact syntax please?

 

Sample response:

{

"Items": [

{

"Timestamp": "2014-07-22T14:00:00Z",

"UnitsAbbreviation": "m",

"Good": true,

"Questionable": false,

"Substituted": false,

"Annotated": false,

"Value": 12.3

},

{

"Timestamp": "2014-07-22T14:00:00Z",

"UnitsAbbreviation": "m",

"Good": true,

"Questionable": false,

"Substituted": false,

"Annotated": false,

"Value": 12.3

}

],

"Links": {}

}

 

Parents
  • Thanks for the response. I've tried that, but somehow not giving expected result. Below is the result before and after adding BadVal('.')=0, it just removes Good status from result, but not excluding the attribute values which are Bad.

     

    Before:

     

     

    {

     "Items": [

      {

       "Name": "UnitOfMeasure",

       "Path": "\\\\AFServer\\AFDatabase\\Equipment1|UnitOfMeasure",

       "Items": [

        {

         "Timestamp": "2023-10-19T22:00:00Z",

         "Value": "%",

         "Good": true

        }

       ]

      },

      {

       "Name": "StorageLocation",

       "Path": "\\\\AFServer\\AFDatabase\\Equipment1|StorageLocation",

       "Items": [

        {

         "Timestamp": "2023-10-19T22:00:00Z",

         "Value": "0001",

         "Good": true

        }

       ]

      },

      {

       "Name": "ProductCode(SICC)",

       "Path": "\\\\AFServer\\AFDatabase\\Equipment1|ProductCode(SICC)",

       "Items": [

        {

         "Timestamp": "2023-10-19T22:00:00Z",

         "Value": "X2136",

         "Good": true

        }

       ]

      },

      {

       "Name": "Plant",

       "Path": "\\\\AFServer\\AFDatabase\\Equipment1|Plant",

       "Items": [

        {

         "Timestamp": "2023-10-19T22:00:00Z",

         "Value": "A017",

         "Good": true

        }

       ]

      },

      {

       "Name": "MeasurementPoint",

       "Path": "\\\\AFServer\\AFDatabase\\Equipment1|MeasurementPoint",

       "Items": [

        {

         "Timestamp": "2023-10-19T22:00:00Z",

         "Value": "FM01T181BDT",

         "Good": true

        }

       ]

      },

      {

       "Name": "Mass",

       "Path": "\\\\AFServer\\AFDatabase\\Equipment1|Mass",

       "Items": [

        {

         "Timestamp": "2023-10-19T22:00:00Z",

         "Value": {

          "Value": 248

         },

         "Good": false

        }

       ]

      }

     ]

    }

     

    After:

     

    {

     "Items": [

      {

       "Name": "UnitOfMeasure",

       "Path": "\\\\AFServer\\AFDatabase\\Equipment1|UnitOfMeasure",

       "Items": [

        {

         "Timestamp": "2023-10-19T22:00:00Z",

         "Value": "%"

        }

       ]

      },

      {

       "Name": "StorageLocation",

       "Path": "\\\\AFServer\\AFDatabase\\Equipment1|StorageLocation",

       "Items": [

        {

         "Timestamp": "2023-10-19T22:00:00Z",

         "Value": "0001"

        }

       ]

      },

      {

       "Name": "ProductCode(SICC)",

       "Path": "\\\\AFServer\\AFDatabase\\Equipment1|ProductCode(SICC)",

       "Items": [

        {

         "Timestamp": "2023-10-19T22:00:00Z",

         "Value": "X2136"

        }

       ]

      },

      {

       "Name": "Plant",

       "Path": "\\\\AFServer\\AFDatabase\\Equipment1|Plant",

       "Items": [

        {

         "Timestamp": "2023-10-19T22:00:00Z",

         "Value": "A017"

        }

       ]

      },

      {

       "Name": "MeasurementPoint",

       "Path": "\\\\AFServer\\AFDatabase\\Equipment1|MeasurementPoint",

       "Items": [

        {

         "Timestamp": "2023-10-19T22:00:00Z",

         "Value": "FM01T181BDT"

        }

       ]

      },

      {

       "Name": "Mass",

       "Path": "\\\\AFServer\\AFDatabase\\Equipment1|Mass",

       "Items": [

        {

         "Timestamp": "2023-10-19T22:00:00Z",

         "Value": {

          "Value": 248

         }

        }

       ]

      }

     ]

    }

Reply
  • Thanks for the response. I've tried that, but somehow not giving expected result. Below is the result before and after adding BadVal('.')=0, it just removes Good status from result, but not excluding the attribute values which are Bad.

     

    Before:

     

     

    {

     "Items": [

      {

       "Name": "UnitOfMeasure",

       "Path": "\\\\AFServer\\AFDatabase\\Equipment1|UnitOfMeasure",

       "Items": [

        {

         "Timestamp": "2023-10-19T22:00:00Z",

         "Value": "%",

         "Good": true

        }

       ]

      },

      {

       "Name": "StorageLocation",

       "Path": "\\\\AFServer\\AFDatabase\\Equipment1|StorageLocation",

       "Items": [

        {

         "Timestamp": "2023-10-19T22:00:00Z",

         "Value": "0001",

         "Good": true

        }

       ]

      },

      {

       "Name": "ProductCode(SICC)",

       "Path": "\\\\AFServer\\AFDatabase\\Equipment1|ProductCode(SICC)",

       "Items": [

        {

         "Timestamp": "2023-10-19T22:00:00Z",

         "Value": "X2136",

         "Good": true

        }

       ]

      },

      {

       "Name": "Plant",

       "Path": "\\\\AFServer\\AFDatabase\\Equipment1|Plant",

       "Items": [

        {

         "Timestamp": "2023-10-19T22:00:00Z",

         "Value": "A017",

         "Good": true

        }

       ]

      },

      {

       "Name": "MeasurementPoint",

       "Path": "\\\\AFServer\\AFDatabase\\Equipment1|MeasurementPoint",

       "Items": [

        {

         "Timestamp": "2023-10-19T22:00:00Z",

         "Value": "FM01T181BDT",

         "Good": true

        }

       ]

      },

      {

       "Name": "Mass",

       "Path": "\\\\AFServer\\AFDatabase\\Equipment1|Mass",

       "Items": [

        {

         "Timestamp": "2023-10-19T22:00:00Z",

         "Value": {

          "Value": 248

         },

         "Good": false

        }

       ]

      }

     ]

    }

     

    After:

     

    {

     "Items": [

      {

       "Name": "UnitOfMeasure",

       "Path": "\\\\AFServer\\AFDatabase\\Equipment1|UnitOfMeasure",

       "Items": [

        {

         "Timestamp": "2023-10-19T22:00:00Z",

         "Value": "%"

        }

       ]

      },

      {

       "Name": "StorageLocation",

       "Path": "\\\\AFServer\\AFDatabase\\Equipment1|StorageLocation",

       "Items": [

        {

         "Timestamp": "2023-10-19T22:00:00Z",

         "Value": "0001"

        }

       ]

      },

      {

       "Name": "ProductCode(SICC)",

       "Path": "\\\\AFServer\\AFDatabase\\Equipment1|ProductCode(SICC)",

       "Items": [

        {

         "Timestamp": "2023-10-19T22:00:00Z",

         "Value": "X2136"

        }

       ]

      },

      {

       "Name": "Plant",

       "Path": "\\\\AFServer\\AFDatabase\\Equipment1|Plant",

       "Items": [

        {

         "Timestamp": "2023-10-19T22:00:00Z",

         "Value": "A017"

        }

       ]

      },

      {

       "Name": "MeasurementPoint",

       "Path": "\\\\AFServer\\AFDatabase\\Equipment1|MeasurementPoint",

       "Items": [

        {

         "Timestamp": "2023-10-19T22:00:00Z",

         "Value": "FM01T181BDT"

        }

       ]

      },

      {

       "Name": "Mass",

       "Path": "\\\\AFServer\\AFDatabase\\Equipment1|Mass",

       "Items": [

        {

         "Timestamp": "2023-10-19T22:00:00Z",

         "Value": {

          "Value": 248

         }

        }

       ]

      }

     ]

    }

Children
No Data