Brad Evans Posted September 29, 2022 Share Posted September 29, 2022 wat to 'switch' data tables after script (via action button). so "run script" would show "data1" listing and a second script ("clear") would switch to "data2" which is: the same Columns as data1, but all missing. works but No columns show Link to comment Share on other sites More sharing options...
Fredrik Rosell Posted October 7, 2022 Share Posted October 7, 2022 Hello,I noticed that there has been no response to this question yet. If you provide a bit more detail, including what your script currently looks like (or even better, an example dxp file), that could increase the chance of getting an answer. Link to comment Share on other sites More sharing options...
Brad Evans Posted October 7, 2022 Author Share Posted October 7, 2022 HI Frederik thank you for the interest. We found a solution which is below. Our first effort removed the dataset completely when we set all values missing/null. Our second effort did NOT select all the columns, so, while the data table part worked no columns were listed.Below is what we did, where MyVis is a script parameter pointing to the data listing visualization=============================================================from Spotfire.Dxp.Application.Visuals import *from Spotfire.Dxp.Data import *from Spotfire.Dxp.Application.Visuals import TablePlot, VisualContentMyVis= MyVis.As[Visualization]()#MyVis.AutoAddNewColumns = True# 1. Change the data tablenewTable = Document.Data.Tables.Item['Medium System Suitability Output'] MyVis.Data.DataTableReference = newTable#2. Move all "Available columns:" to the "Selected columns:" listbox:MyVis.TableColumns.Clear() #Clear first to prevent duplicate errorfor i in newTable.Columns: MyVis.TableColumns.Add(i) Link to comment Share on other sites More sharing options...
Fredrik Rosell Posted October 7, 2022 Share Posted October 7, 2022 Thank you for sharing that with the community, Brad! 👍 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