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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

query to filter in thingtemplate services

AP_9587236
17-Peridot

query to filter in thingtemplate services

Please tell me the query format to write in this tab to filter rows.

AP_9587236_1-1640089854173.png

 

ACCEPTED SOLUTION

Accepted Solutions
M4RC
14-Alexandrite
(To:AP_9587236)

Hello,

you can use a command like this:

{

  "filters": {

         "type": "EQ",

         "fieldName": "CustomerId",

         "value": 2

    }

}

If necessary, use this older article as a guide for the parameters (TWX 8 doc): 

http://support.ptc.com/help/thingworx_hc/thingworx_8_hc/en/#page/ThingWorx/Help/Composer/Things/ThingServices/QueryParameterforQueryServices.html

 

View solution in original post

4 REPLIES 4
M4RC
14-Alexandrite
(To:AP_9587236)

Hello,

you can use a command like this:

{

  "filters": {

         "type": "EQ",

         "fieldName": "CustomerId",

         "value": 2

    }

}

If necessary, use this older article as a guide for the parameters (TWX 8 doc): 

http://support.ptc.com/help/thingworx_hc/thingworx_8_hc/en/#page/ThingWorx/Help/Composer/Things/ThingServices/QueryParameterforQueryServices.html

 

AP_9587236
17-Peridot
(To:M4RC)

Iam getting error when i given this query. What is the mistake here. @M4RC 

{
"filters":
{
"type": "AND",
"filters": [{
"type": "EQ",
"fieldName": "MachineName",
"value": MachineName
},{
"type": "EQ",
"fieldName": "TaskName",
"value":oldTaskName
}]
}
};

M4RC
14-Alexandrite
(To:AP_9587236)

You can try this:


{"filters":
 {
  "type": "And",
  "filters": [
     {
     "type": "EQ",
     "fieldName": "MachineName",
     "value": "MachineName"
     }, {
     "type": "EQ",

     "fieldName": "TaskName",
     "value": "TaskName"
     }

  ]

 }
}

Example for Values: 

"value": "string"

"value": 10

"value": 1.2

 

You need to remove the last ;

AP_9587236
17-Peridot
(To:M4RC)

Thank you

Announcements


Top Tags