Script format for defining Workflow parameter value

Hopefully a basic question but can't find an answer; When using a script to set the value of a Parameter in the Workflow options and start conditions, how is the script defined? I've tried using the below, but the Parameter value is empty, I cant find an example of setting the value in the SDK:

function onInit($context){

 $workflow.Parameter("TestParam")="Test Value"

}

Top Replies

Parents
  • To expand on what   said, when defining your Parameter for your workflow in the workflow configuration itself, you have the option for its value to be obtained from a script.  A clearer example might be as follows:

    Function ProvideMyParameterValue ($Request)
    {


    return "Some Data for My Parameter"

    }

    So, when you define the source for the Parameter, you would reference the script and within the script, the function ProvideMyParameterValue.  The data that would come back (in this case) is the hard coded string Some Data for My Parameter.  Of course, you could just as easily substitute a variable there - i.e. $MyVariable which the code in the script would populate.

Reply
  • To expand on what   said, when defining your Parameter for your workflow in the workflow configuration itself, you have the option for its value to be obtained from a script.  A clearer example might be as follows:

    Function ProvideMyParameterValue ($Request)
    {


    return "Some Data for My Parameter"

    }

    So, when you define the source for the Parameter, you would reference the script and within the script, the function ProvideMyParameterValue.  The data that would come back (in this case) is the hard coded string Some Data for My Parameter.  Of course, you could just as easily substitute a variable there - i.e. $MyVariable which the code in the script would populate.

Children
No Data