Scoped variables
The Portal allows you to define variables that are visible to several components within the Portal. For example, it may be useful to store the current year in a Scoped Variable. These scoped variables are linked to a specific folder or dashboard and are only visible to that object and all its descendants.
Scoped variable settings
Scoped variables are defined as static or dynamic in the Expression Settings of the variable's properties.
- A static scoped variable can take an explicitly defined value (for example, the integer 20). Explicitly defined values are specified by the Value property.
- A dynamic scoped variable can take a value determined by a formula acting on the current session data (say, today's date, or the current user's first name). Formula-defined values are determined by the Select Statement attribute, which contains a SQL query.
Setting | Description |
---|---|
Expression Type | Determines whether the value of the scoped variable is a dynamic (based on a query) or a static value. |
Static value | This setting appears when the Static expression type is selected. |
Source Connection | This setting appears when the Dynamic expression type is selected. It defines the SQL connection that will be used to perform the dynamic query. |
Select Statement | This setting appears when the Dynamic expression type is selected. |
Nested scoped variables
Scoped Variables can be nested within each other. To nest a scoped variable, place an @@VARIABLE reference in the Select Statement or Static value properties of the scoped variable.