Casy Horsley Posted January 7, 2021 Share Posted January 7, 2021 I'm looking for a way to allow users in the viewer to see the details on demand section only when they mark a visualization. I don't want the details on demand to always be visible. I only want it to "pop up" when something is chosen and then when markings are cleared, it to go away. Is there anyone who has accomplished this or something similar using a script If so, would you be willing to provide *EDITED TO ADD* the python script works on it's own but when paired with the documetn properties, it is not working. Can someone review my setup screenshots and let me know where I have missed Link to comment Share on other sites More sharing options...
Shandilya Peddi Posted January 8, 2021 Share Posted January 8, 2021 You can acheive this using Data Functions and IronPython scripting. Check the following knowledge base article on how to trigger an IronPython script upon marking, https://support.tibco.com/s/article/Tibco-KnowledgeArticle-Article-45663 You can use the below script to toggle the details on demand panel based on marking, from Spotfire.Dxp.Data import * #get the table which will be marked table=Document.Data.Tables["SalesAnzzdMarketing"] #get the current data selection dataSelection=Document.ActiveMarkingSelectionReference #get the row selections rowSelection=dataSelection.GetSelection(table) # check the row count in the markings selected rowCount= rowSelection.IncludedRowCount #get the DOD panel panel=Document.ActivePageReference.DetailsOnDemandPanel #check if marked rows are 0 or more and toggle the DOD panel if rowCount==0 : if (panel.Visible): panel.Visible=False else: if(panel.Visible==False): panel.Visible=True You can also check the following custom extension that can be used instead of a data function, https://community.spotfire.com/wiki/custom-datetime-data-function-tibco-spotfire Link to comment Share on other sites More sharing options...
Casy Horsley Posted January 11, 2021 Author Share Posted January 11, 2021 This was very helpful! The script works flawlessly when ran on its own but when pairing it with the data funtion/doc properties I am not able to get it to work. On the attachment I've included screenshots of the setup. I have tried adjusting the marking/filters. I also adjusted the expression on the Input parameter. Can you explain what that expressions purpose is Counting the column seems generic so not sure if it matters which column I choose. Thanks again. Link to comment Share on other sites More sharing options...
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