parameter

The parameter property allows you to read and write parameters that exist in the context of the Dashboard and user session. Parameters can be created in several ways, including the following:

The syntax for accessing a parameter is

parameter.variableName

where variableName is the name of the Variable asset defined in the Data Worksheet or the Form component defined in the Dashboard.

Example: Read value of stateSelector parameter
parameter.stateSelector
Example: Read value of RadioButton1 Form component
parameter.RadioButton1
Example: Define new parameter in Dashboard script
parameter.myParamName = 'Hello';

parameter._GROUPS_

Property is read-only. It cannot be set in script.

Returns an array of groups to which the current user belongs.

Type

Array of Strings

Groups to which current user belongs

Example

alert('User belongs to: ' + parameter._GROUPS_.join(', '))

parameter._ROLES_

Property is read-only. It cannot be set in script.

Returns an array of roles possessed by the current user.

Type

Array of Strings

Roles possesed by current user

Example

alert('User roles: ' + parameter._ROLES_.join(', '))

parameter._USER_

Property is read-only. It cannot be set in script.

Returns the username of the current user.

Type

String

Username of current user

Example

alert('Logged in as ' + parameter._USER_)
Property is read-only. It cannot be set in script.

Returns the hostname and port of the server hosting the dashboard.

Type

String

Server hostname

Example

alert('This server is named ' + parameter.__LINK_HOST__)

parameterLINKHOST

Property is read-only. It cannot be set in script.

Returns the root URL at which the current dashboard is being accessed.

Type

String

Dashboard URI

Example

alert('This dashboard is served from ' + parameter.__LINK_URI__)

parameterLINKURI

parameter.__principle__

Property is read-only. It cannot be set in script.

Returns the SRPrincipal object, which contains session information. See Access the User Session in Advanced Server Integration for details on writing user data to SRPrincipal.

Type

Object

SRPrincipal object

Example

var p = parameter.__principal__;
p.setParameter('State', ['NJ', 'NY', 'CT']);

parameter.length

Property is read-only. It cannot be set in script.

Returns the number of currently defined parameters.

Type

Integer

Number of currently defined parameters

Example

alert(parameter.length)

parameter.parameterNames

Property is read-only. It cannot be set in script.

An array containing the current parameter names.

Type

String

Parameter Name

Example

alert(parameter.parameterNames[0])