Jump to content
  • How to Replace the Information Link Data Source using SourceView in Spotfire® Using IronPython Scripting


    This article provides a sample script on how to replace the Information Link data source only of a given data table. This helps to replace just the data source and the operation applied on the data table like calculated columns etc remain as is

    Introduction

    This article provides a sample script on how to replace the Information Link data source only of a given data table. This helps to replace just the data source and the operation applied on the data table like calculated columns etc remain as is

    Code Sample

    # Copyright © 2019. TIBCO Software Inc. Licensed under TIBCO BSD-style license.
    
    from Spotfire.Dxp.Data import *
    from Spotfire.Dxp.Data.DataOperations import *
    from System import Guid
    from Spotfire.Dxp.Data.Import import *
    
    table=Document.ActiveDataTableReference
    
    sourceView=table.GenerateSourceView()
    #get the dat atbale data source operation
    op=sourceView.GetAllOperations[DataSourceOperation]()[0]
    
    #build the data flow
    dataSource= InformationLinkDataSource(Guid("94134318-1116-48f0-a250-b74e41a68f1c"),None,"test")
    dataFlow = DataFlowBuilder(dataSource, Application.ImportContext).Build()
    
    #replace the data source
    if op.CanReplaceDataFlow():
    	op.ReplaceDataFlow(dataFlow)
     

    References

    License:  TIBCO BSD-Style License

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...