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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Query ValueStream with null entries

rwondoloski
1-Newbie

Query ValueStream with null entries

I get the following error when invoking a simple query on a value stream (using the DataFilter and TimeSelectors in the mashup).

 

[context: com.thingworx.webservices.context.HttpExecutionContext@71e1b30c][message: Unable to Invoke Service QueryPropertyHistory on N4A_Thing : null]

 

Is this because the field I am querying has null values?  The query is simply gps_status equals to 1.  There are lots of entries where this exists, but all I get is the error.

 

If I am not allowed to have null entries in the ValueStream, then how do I avoid this?  I need to filter out invalid location data when the GPS status is not valid.

1 ACCEPTED SOLUTION

Accepted Solutions
billrei
5-Regular Member
(To:rwondoloski)

Unfortunately, null in this case is probably the text description of the exception being thrown and not a reference to the values in your value stream. Could you try to make this call within a service to eliminate the possibility of a problem with your mashup bindings?

View solution in original post

3 REPLIES 3
billrei
5-Regular Member
(To:rwondoloski)

Unfortunately, null in this case is probably the text description of the exception being thrown and not a reference to the values in your value stream. Could you try to make this call within a service to eliminate the possibility of a problem with your mashup bindings?

Bill,

Thanks for the response. 

I try to test the query using a the built in QueryPropertyHistory, but get an error on my query syntax.  What is the correct syntax to perform the SELECT * WHERE gps_status = 1....This SQL type query gives an error about not following JSON query.  I am not familiar with, or can I find reference to JSON query....

Invalid QUERY value. Please make sure it's a valid JSON string


Thanks for the help!

Rob

qn
1-Newbie
1-Newbie
(To:rwondoloski)

What is your actual query ?

Based on the DOC 6.5 (http://support.ptc.com/cs/help/thingworx_hc/thingworx_6.5_hc/index.jspx?id=QueryParameterforQueryServices&action=show):

var query =

{

      filters:

     {

          type: "EQ",

          fieldName: "gps_status",

          value: "1"

     }

};

Top Tags