Forum Discussion

Sergey's avatar
Sergey
Contributor III
3 years ago
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,

  • 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

     

  • JackLacava's avatar
    JackLacava
    Honored Contributor

    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