Is there a way to set the parameters of a Javascript dynamically when using Javascript Task.

Is there a way to set the parameters of a Javascript dynamically when using Javascript Task.

When using JavaScript Task, sometime you create parameters in your JavaScripts, like you see here in the screen capture. You may want to set their values dynamically using variables in the variables window.



From the documentation:
Under the hood, in JavaScript Task for each parameter, which has a non-default value, there is an automatically created task-scoped variable. This allows you to specify an expression in the Variable Windows in case you need to set this value dynamically.

The values you give to these task-scoped variables will automatically populate the values for the script and there is no need for additional expressions in the tasks properties to be created to set the values.

Please be aware of the following note for non-required parameters in cases when you are not seeing their corresponding task-scoped variables:
The task-scoped variable mentioned above can only be seen after you have provided a non-default value for the parameter within the JavaScript Task editor and when you have place focus on the JavaScript Task during your package development.
Example: variable is not visible

Example: variable is visible


Once the parameter has been given a value, the task-scoped variable will persist whether a value is given or not in the editor.



    Book a Presales Call


    Are you new to COZYROC and evaluating our solutions? 
    Book a Presales Call with us now and get 5% off SSIS+.