Search code examples
ironpythonspotfire

Spotfire IronPython script: Delete a data-table


I am new to iron-python. I would be obliged if anyone can tell me how to completely delete a data-table using iron-python?


Solution

  • you can do this pretty easily with:

    dt_name = "Data Table" # name of the data table
    
    dt = Document.Data.Tables[dt_name]
    
    Document.Data.Tables.Remove(dt)
    

    of course you can compress this all to:

    Document.Data.Tables.Remove(Document.Data.Tables["Data Table"])