on
04-07-2022
02:08 PM
- edited on
09-28-2023
06:17 AM
by
JackLacava
Literal Parameters are, effectively, application-wide variables that can be used to drive Dashboards and Cube Views. Their values can be set or retrieved in code as shown below.
From version 7.3 onwards, they are contained in a Workspace. That means that the relevant calls now require the ID of the Workspace where the Parameter is located. Note that the ID of Default Workspace is an empty Guid.
Note: Literal Parameters are effectively shared between all users; which means that, if a Dashboard Action triggered by "User1" modifies a Literal Parameter value, "User2" will also receive the changed value in any Dashboards they are using (at the first refresh).
Dim parameterName As String = "MyParameterName"
' if Parameter lives in Dashboards under "System" tab, set this to True
Dim isSystemLevel as Boolean = False
' retrieve workspace ID. If it's Default Workspace, you can just use Guid.Empty instead
Dim workspaceID As Guid = BRApi.Dashboards.Workspaces.GetWorkspaceIDFromName( _
si, isSystemLevel, workspaceName)
' --- Set literal parameter value
Dim newValue As String = "New Literal Value"
BRApi.Dashboards.Parameters.SetLiteralParameterValue( _
si, isSystemLevel, workspaceID, parameterName, newValue)
' --- Retrieve literal parameter value
Dim pValue as String = BRApi.Dashboards.Parameters.GetLiteralParameterValue( _
si, isSystemLevel, workspaceID, parameterName)
Dim parameterName As String = "MyParameterName"
' if Parameter lives in Dashboards under "System" tab, set this to True
Dim isSystemLevel as Boolean = False
' --- Set literal parameter value
Dim newValue As String = "New Literal Value"
BRApi.Dashboards.Parameters.SetLiteralParameterValue( _
si, isSystemLevel, parameterName, newValue)
' --- Retrieve literal parameter value
Dim pValue as String = BRApi.Dashboards.Parameters.GetLiteralParameterValue( _
si, isSystemLevel, parameterName)