Jump to content

How to create a filtering scheme using Iron Python

Georgi Koemdzhiev

Recommended Posts

Hello! Is it possible to create a new Filtering Scheme and set it to a page only using Iron Python The reason why I am looking into that is becausethe Web Player currently does not allow us to create Filtering Schemes. I hope to achieve that by executing a script which will be triggered by a Document property change. The name of the filtering scheme will be passed from the JavaScript api my using Document.SetDocumentProperty method.

The script below adds a new Filtering Scheme but I cannot select it from the Filtering Scheme menu in the Spotfire Analyst, it's nowhere to be seen. What am I missing

from Spotfire.Dxp.Data import *

from Spotfire.Dxp.Application.Filters import *


Document.ActivePageReference.FilterPanel.Visible = True

# Add a new data filtering selection.

filterings = Document.Data.Filterings


filterings.Add("Test Filtering 1")


for f in filterings:

print f.Name

I cannot see my newly added FilteringScheme after I ran the above script from the Filtering Scheme menu on the Analyst:

Link to comment
Share on other sites

The script works for me and I can see the filtering schemes. Not sure if this is what has happened, but after you run the script from the script editor did you select okay or cancel . May be the changes were not applied because of this In the script editor output you shared we can see that the filtering "Test Filtering 1" has been added
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...