Georgi Koemdzhiev Posted October 3, 2019 Posted October 3, 2019 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:
Shandilya Peddi Posted October 7, 2019 Posted October 7, 2019 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
Georgi Koemdzhiev Posted October 7, 2019 Author Posted October 7, 2019 Thanks, Shandilya! I got it working. For some reason the script didn't work when I just pressed "Run Script" button. I had to attach the script to a Button (in a Text Area) to get it to work.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now