Jan 5, 2016

Change Data Table Using Python Script in Spotfire

Change Data Table


##### Change Data table

from Spotfire.Dxp.Application.Visuals import VisualContent

tbl = currentTableVisualization.As[VisualContent]()
newtbl = Document.Data.Tables.Item['Data']
tbl.Data.DataTableReference=newtbl
tbl.AutoConfigure()
tbl.ApplyUserPreferences()

2 comments:

Unknown said...

Hi,

I'm trying to use this code with a property control drop down for the users to change the data tables to whichever one they want to use from the PC, but I get the following error message:
"line 3, in NameError: name 'currentTableVisualization' is not defined"

Any ideas what I'm doing wrong?

Many thanks,

@mbi said...

currentTableVisualization is a parameter, which is expecting the table chart name. need detail steps?