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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Query "IN" filter

apretorius
6-Contributor

Query "IN" filter

Hey guys

I have a query that returns values to an infotable. I then want to query another table that contains the values returned in the first infotable using the "type" : "IN" filter, but I am not getting any results back. Can someone please push me in the right direction ?

 

The initial table query looks like this and returns 3 rows of values


var params = {
priority: Priority /* STRING */
};

// result: INFOTABLE dataShape: South32.Assign.Alerts.DataShape
var Alerts = Things["South32.HelperThing"].GetAlerts(params);

var DistinctParams = {

t: Alerts /* INFOTABLE */,
columns: "name" /* STRING */

};

// result: INFOTABLE

var DistinctProbes = Resources["InfoTableFunctions"].Distinct(DistinctParams);

 

I now want to use these values as filter values on a subsequent query.

 

1 REPLY 1
PaiChung
22-Sapphire I
(To:apretorius)

Are you creating a JSON array list of the values from the first Query to pass into the next query for the IN?

If you look here: 

http://support.ptc.com/help/thingworx_hc/thingworx_8_hc/en/#page/ThingWorx%2FHelp%2FComposer%2FThings%2FThingServices%2FQueryParameterforQueryServices.html

 

it shows the example of the IN

var jsonArray = [12,14];
var query = {
"filters": {
"type": "IN, NOTIN",
"fieldName": "Duration",
"values": jsonArray
}
};

Top Tags