Overwriting a SBDF file from Spotfire using Iron Python


I am successfully able to create a SBDF file using the below script in iron pyhton 

Python Script Implementation for TIBCO Spotfire Binary Data Format (*.Sbdf):


from Spotfire.Dxp.Framework.Library import LibraryManager, LibraryItemType, LibraryItem, LibraryItemRetrievalOption

dataTable = Document.Data.Tables.TryGetValue("Test File")[1]
folder = "/Test/"
fileName = "FirstExport"

lm = Application.GetService(LibraryManager)
table = Document.ActiveDataTableReference
(found, item) = lm.TryGetItem(folder, LibraryItemType.Folder, LibraryItemRetrievalOption.IncludeProperties)
if found:
    table.ExportDataToLibrary(item, fileName)
    print "abc"


However after exporting the data table for the first time,

I am not able to export it for the second time to the  SBDF file in the library, or not able to overwrite the file.

Can you please help me out with an iron python code to Replace/Overwrite or Add Row an SBDF file from Spotfire.


Thanks in Advance.. 




Image icon capture12.jpg40.56 KB

(1) Answer