Jump to content
  • How to Pass Value to an Input Parameter of a Data Function in Spotfire® using IronPython Scripting


    Included is a code snippet o set the value of an Input Parameter of a Data Function from Iron Python Script

    Introduction

    Below is a code snippet on how to set the value of an Input Parameter of a Data Function from Iron Python Script

    Code Sample

    # Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license.
    
    from Spotfire.Dxp.Data import *
    from Spotfire.Dxp.Data.DataFunctions import *
    
    dataManager = Document.Data
    dataFunction = None
    
    for function in dataManager.DataFunctions:
    	if function.Name == 'dataFunctionName':
    		dataFunction = function
    		for inputs in dataFunction.DataFunctionDefinition.InputParameters:	
    			if inputs.DisplayName=="inputParameterName":
    				dataFunction.Inputs.SetInput(inputs,"DateTimeNow()")
    				#To pass a string value using expressions
    				#dataFunction.Inputs.SetInput(inputs,"String("HelloWorld")")
     

    References

    License:  TIBCO BSD-Style License

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...