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

Community Tip - You can change your system assigned username to something more personal in your community settings. 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,
Email: psp316r@outlook.com,
Mobile: +91 8099838001.
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

Announcements


Top Tags