Zack
11/04/2019, 7:34 PMvar formula = [
String("formulatext: CASE WHEN {name} IN (" + items + ") THEN 'T' ELSE 'F' END"),
"startswith",
"T"
];jkabot
11/04/2019, 7:53 PMZack
11/04/2019, 8:14 PMtoltmanns
11/04/2019, 8:15 PMtoltmanns
11/04/2019, 8:15 PMZack
11/04/2019, 8:19 PMjkabot
11/04/2019, 8:20 PMZack
11/04/2019, 8:22 PMjkabot
11/04/2019, 8:30 PMsearch.filters is meant to be a list of "filter" objects. To define filters using nested arrays of strings, you need to use search.filterExpression instead.
However, search.filterExpression is implemented in a funny way, and if you call push on it directly, it will not update the search. You need to reassign the value entirely.
var formula = [ ... ];
var parentdata = search.load(...);
// copy filters
var expr = parentdata.filterExpression.slice();
// edit copy
expr.push('AND', formula);
// reassign filters
parentdata.filterExpression = expr;
var results = parentdata.run...Zack
11/04/2019, 8:34 PM