Altair® Panopticon

 

Adding Script Actions

Script actions allow execution of a defined JavaScript.

Steps:

1.   On the Dashboard  and Workbook Settings pane, click the Workbook tab.

The Actions pane is displayed. Initially, there are no actions defined for the workbook and the selected Dashboard Scope is All.

 

2.     Select the Dashboard Scope where you will define the dashboard scope data parameters that will be passed to the target dashboard: All or Current.

3.     Select the Source Data Table from the drop-down list.

4.     Click the New Action button then select Script Action in the drop-down list.

The new script action is added under the selected Dashboard Scope in the Actions list. For example, if Current is the selected dashboard scope and the source data table is Equity Portfolio, then it will be displayed as:

 

However, if no source data table is selected, then the first one in the Data Table pane (i.e., StocksAnalysis) is the default associated to the new script action.

 

5.     Click the new script instance to expand and display the properties that you can define.

 

6.     Enter or select the following properties:

Setting

Description

Name

The name of the script action and then click .

Dashboard Scope

The dashboard where you will define the dashboard scope data parameters that will be passed to the target dashboard.

Can either be [All Dashboard] or the current dashboard.

Data Table

The source data table. This will eventually be displayed above the script action instance.

Script

The parameterized script.

The parameters are written within curly brackets, {ParameterName}.

For script actions allowing multiple value input, you can optionally specify a value separator within the curly brackets where you put the parameter name. The syntax is as follows:

{ParameterName:Separator}

For example: {Company:|}

Default separator is comma. At execution, the parameter will be replaced with real field values associated with the selected visualization node.

NOTE: The entered JavaScript should not include constructs that utilize curly brackets, as these are reserved for the processing of parameters.

In addition, the entered JavaScript should not include single line comments

 

7.     Click the  button to add parameters to the output script. A new parameter instance is added.

 

8.     Click on the parameter instance to expand and define its properties.

 

For each parameter added, set or select the following properties:

Setting

Description

Name

Name of the script action parameter and then click .

Value Source

Column from the data source table that will supply the contextual value.

The value of this selected column for rows under the selected visualization node will be passed as the parameter values to the target URL.

Multiple Values

This passes multiple values for the parameter to the target area. Tap the slider to turn on. The Value Separator field displays.

Specify the value separator to be used.

Input Validation and Error Message

Both fields are enabled when an interactive parameter (i.e., $Interactive)  is selected in the Value Source drop-down list.

Typically, interactive parameters are used to pass data back to data repositories or external systems.

When an action is executed which require an interactive parameter, an associated dialog box will be displayed.

For example:

Add a custom Input Validation. This can be any regular expression (e.g., “A-Z{3}”)

The parameter will not be updated unless it passes the validation. Enter an Error Message to help in defining a better input to match the regular expression (e.g., “Please use a 3-letter code.”)

 

You can delete any of the added parameters by clicking the corresponding Delete  button.

9.     Repeat step 7 to add more parameters.

10.   Click the Save  icon on the toolbar to save the changes.

When saved, the  notification is displayed.

Clicking the All Dashboard Scope, the new script action is available.

 

 

If the Dashboard Scope is [All Dashboard], the new script action will be displayed as: