Jump to content

Inject list box filter values into the search field by using the JavaScript API

Georgi Koemdzhiev

Recommended Posts


I am trying to figure out if there is a way to inject search expression intoa ListBoxFilter in my analysis file using only the WebPlayer's JavaScript API (https://t.ly/bmzvG). For example, in my analysis file, I have a ListBoxFilter called "API - 14/UWI Unformatted" (see attached image). I would like to allow the user to paste a list of values - "value1, value2"into a textarea html element that is on the same page as the Spotfire WebPlayer itself. Then, a javascript code will format the list of values so that they are separated by "or" (e.g. value1 or value2, the ListBoxFilter accepts that expression and will select both value1 and value2 from the list).


Could anyone please confirm if the JavaScript allows access to a specific filter in the opened analysis document so that I can set its searchfield with the formated text

Link to comment
Share on other sites

The JavaScript in text area does not have access to the filters. One workaround would be to set the formated values to a document property and then trigger an IronPython script to set the search expression for the ListBoxFilter using the value in the document property. Below are some references,



Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...