Skip to main content
OneStream Employee
January 5, 2023
Solved

List all CustomSubstVars from current dashboard ?

  • January 5, 2023
  • 1 reply
  • 0 views

Dear Community,

There is a possiblity to retrieve parameters currently available in a dashboard using for instance : 

 

 

Dim str_myParam As String = args.SelectionChangedTaskInfo.CustomSubstVars.XFGetValue("MyParameter")

 

 

However, this means that we need to know the names of the CustomSubstVars currently in the dashboard (in that case, I need to know that the parameter MyParameter is indeed available in the dashboard).

In my use case the user can open several cube view hence the parameters will change from one Cube View to another.  Is there a way to list all current CustomSubstVars available in the dashboard ? 

 

Regards,

Best answer by JackLacava

CustomSubstVars is a VB.Net Dictionary, so you can play around with its keys.

For Each key As String In args.SelectionChangedTaskInfo.CustomSubstVarsWithUserSelectedValues.Keys
    brapi.ErrorLog.LogMessage(si, $"{key} is present")
Next

Dim isPresent as Boolean = 
args.SelectionChangedTaskInfo.CustomSubstVarsWithUserSelectedValues.Contains("myKey")

' ... etc etc

 

1 reply

OneStream Employee
January 5, 2023

CustomSubstVars is a VB.Net Dictionary, so you can play around with its keys.

For Each key As String In args.SelectionChangedTaskInfo.CustomSubstVarsWithUserSelectedValues.Keys
    brapi.ErrorLog.LogMessage(si, $"{key} is present")
Next

Dim isPresent as Boolean = 
args.SelectionChangedTaskInfo.CustomSubstVarsWithUserSelectedValues.Contains("myKey")

' ... etc etc