Operational Analytics Help

Map Script Parameters to Input and Output Variables

Before a script can be run on data, the inputs and output variables listed in the grid must be mapped to corresponding parameters in the script. At runtime, the framework will then know which input data to use for each variable used by the script and where to store any outputs.

To start the mapping, if the script isn’t already selected, click the Open Script button:

This activates a window that allows you to select a compatible script to run. There should be some scripts

When you double-click on a script, the script will be loaded and the Active Script button on the toolbar will display the Name of the chosen script. If it is the correct script, you can then close the Choose script window.

Note: Be aware that you can delete an active script by pressing the red cross button on the toolbar. Please be careful with this feature as, once the script is deleted, it is removed from the remote server and it cannot be recovered.

The next step is to open the Script editor window.

When the window opens, move the window to the right of the screen, so you can see all of the columns in the selection grid below it.

Select the Parameter tab.

This example demonstrates that 3 variables area needed, two inputs and one output. The window is blank because the script has no parameters added yet.

Press the Add Parameter button 3 times to create 3 default parameters in the grid.

Now edit the names of the parameters to match exactly the names of the parameters that the script’s R code expects to read from and write to.

Double-click on the name to change it. Same with units, which can be blank (but you will receive a warning).

For In/Out, either select Input or Output, or type input or output. The format must match the variables to which you are mapping.

Once the parameters are ready, drag each in turn across and drop on to the relevant row in the Selected Points grid below. The Script Parameter column will update to show the mapped parameter. If you make a mistake or need to change anything, make the changes and drag the parameter over again.

Press the Save button on the Script editor before doing anything else.

The parameters will now be mapped to the selected variables.