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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Filters for the Datashape Query is not working

pshashipreetham
17-Peridot

Filters for the Datashape Query is not working

Adding filters to the Datashape Query, how should it be done ?
As of now I am using following code..

var queryToAvoidPowderMixTables = {
   "filters":{
      "type": "NE",
      "fieldName": "Source",
      "value": "Powder_Mix"
   }
}; 

var params = {
    filter: filter,
    dataShapeName: "PTC.SCA.SCO.MaterialDefinition",
    offset: offset,
    limit: limit,
    query: queryToAvoidPowderMixTables
};

var MaterialDefinitions = Things["PTC.SCA.SCO.PostgresDatabase"].Query(params);
MaterialDefinitions.Sort({ name: "UID", ascending: false });

but the query for "Power_Mix" is not working..

Thanks,
Shashi.

Shashi Preetham
1 ACCEPTED SOLUTION

Accepted Solutions

@pshashipreetham ,

 

It looks like you might need to form your JSON a bit differently.  See here:

 

https://support.ptc.com/help/thingworx/apps/r9.1/en/#page/thingworx_apps/Customizing_Operator_Advisor/using_JSON_filters.html

 

Hope that helps,

Nick

View solution in original post

1 REPLY 1

@pshashipreetham ,

 

It looks like you might need to form your JSON a bit differently.  See here:

 

https://support.ptc.com/help/thingworx/apps/r9.1/en/#page/thingworx_apps/Customizing_Operator_Advisor/using_JSON_filters.html

 

Hope that helps,

Nick

Top Tags