Skip to main content
Employee - Guide
Jan 5, 2023 10:26 AM UTC
Solved

List all CustomSubstVars from current dashboard ?

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,

Employee - Sage
Jan 5, 2023 1:12 PM UTC

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

Employee - Sage
Jan 5, 2023 1:12 PM UTC

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