1

I have a script (2.0) successfully running saved searches and writing the results to CSV files in the File Cabinet via the N/task.searchTask.

The issue is that the full system requires multiple saved searches that vary only by date range, and multiple script deployments configured with the same script parameterized by Saved Search Id and File Id (for the results). It would be better/simpler to have one Saved Search and have parameters for the data range instead of having multiple Saved Searches.

Is there a path using the N/task.searchTask that allows for the adding of Filters on the Saved Search?

netsour
  • 11
  • 2
  • Not that I have found since it only takes a reference to a saved search. You can load, modify and save a saved search before using N/task to run it however. An added complexity is making sure you only run one search task at a time so it has the correct filters. – Brian Oct 15 '20 at 12:25

1 Answers1

1

You can use the N/search module to load Saved Searches and modify them however you see fit before executing them. You could certainly load a Search then manipulate its filters property before running the search.

erictgrubaugh
  • 8,519
  • 1
  • 20
  • 28