Skip to main content
1-Visitor
September 9, 2019
Solved

'IN' query of Datatable not working

  • September 9, 2019
  • 2 replies
  • 1068 views

I'm querying a datatable, and passing this query (below). If I run the QueryDataTable entries with this query, it returns no results. If I just change the Station parameter to be "EQ" and just add the machine name as a string, the query works as expected (returning 40+ results). 

 

What gives? What am I doing wrong?

 

 

 

 

 

var machineArray = ['my_machine_name'];

 

var query = {
"filters": {
"type": "And",
"filters": [
{
"type": "IN",
"fieldName": "Station",
"value": machineArray
},
{
"type": "EQ",
"fieldName": "Program",
"value": Transmission
},
{
"type": "EQ",
"fieldName": "Operation",
"value": Operation
}]}};

 

var myQueryResults = Things["Ford.PFS.GM.Historian.Repository"].QueryDataTableEntries({
maxItems: 200000 /* NUMBER */,
values: undefined /* INFOTABLE */,
query: query /* QUERY */,
source: undefined /* STRING */,
tags: undefined /* TAGS */
});

Best answer by PaiChung

Perhaps you'll need to enter a support ticket, syntax looks fine.

2 replies

PaiChung22-Sapphire IAnswer
22-Sapphire I
September 9, 2019

Perhaps you'll need to enter a support ticket, syntax looks fine.

ague1-VisitorAuthor
1-Visitor
September 9, 2019

Thank you - I just opened a ticket.