PF
09/10/2024, 8:27 PMCeligo AI
09/10/2024, 8:27 PMAI generated answer (using internal Slack threads):To add a filter of an array variable to
search.create
in a script, you can use the filterExpression
property of the search object. This property allows you to get the existing filter expression and modify it by adding your own filter expression. Here's an example of how you can do this:
javascript
var expr = search.filterExpression;
expr.push(['your', 'added', 'filter']);
search.filterExpression = expr;
Or you can use the concat
method to add your filter to the existing filter expression:
javascript
search.filterExpression = search.filterExpression.concat(['your', 'added', 'filter']);
If you want to add OR expressions when adding search filters, you can create the filters like [ search.createFilter(), 'OR', search.createFilter() ]
.
For dynamic filters, you can use any programming logic to create the filter based on your conditions. Here's an example:
javascript
var dynamicFilter = null;
if (condition) {
dynamicFilter = search.createFilter({})
} else {
dynamicFilter = search.createFilter({})
}
var filters = searchObj.filters;
filters.push(dynamicFilter);
searchObj.filters = filters;
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
09/10/2024, 8:27 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.818150163
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.814594924
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.806869805
Celigo AI
09/10/2024, 8:27 PM