How to populate a Dashboard List Box referencing WFText4 but the UD dim may vary across Workflows?
As the title suggests, I am trying to populate a dashboard list box that references the Workflow text property regardless of the dimension being used. I'm able to populate the list box using a single dimension, meaning a UD3 member is populated on the workflow's WFText4 property and a member list parameter uses |WFText4| to pull it in. How would I get this to work if the Workflow text value is not always UD3? For Example (both workflows will be using WFText4): Canada Workflow A needs a UD3 Member.Base to populate in the list box when they run the dashboard in their workflow but Canada Workflow B needs a UD6 Member.Base to populate the list box when they run the dashboard in their workflow. Please let me know if I can provide more context.
Hi MichaelHahn
You could achieve this if you include the Dimension Token in your WFText4. You can then check the dimension via the token e.g. UD3#Top.Base versus UD6#Top.Base, etc
You can use something like this Dictionary where the key is the DimToken and the Value is the DimTypeName, etc. My original logic had it the other way round but this works better for your use case
Public Function GetDimTokenDictionary(ByVal si As SessionInfo) As Dictionary(Of String, String) Try ' Create object to return Dim dimDict As New Dictionary(Of String, String) ' Retrieve all dimensions Dim allDims As List(Of String) = DimType.GetAllDimTypes.Select(Function(dimType) dimType.Name).ToList() ' Loop allDims List For Each dimension As String In allDims ' Handling for UD's If dimension.StartsWith("U") Then ' Add Dimension and DimToken to dimDict for UD's dimDict.Add(StageConstants.MasterDimensionTokens.GetDimensionToken(StageConstants.MasterDimensionNames.GetDimensionName(StageConstants.MasterDimensionNames.GetDimensionLongName(dimension.Replace("D", String.Empty)))), dimension) Else ' Add Dimension and DimToken to dimDict for all other Dims dimDict.Add(StageConstants.MasterDimensionTokens.GetDimensionToken(StageConstants.MasterDimensionNames.GetDimensionName(dimension)), dimension) End If Next dimension ' Return Return dimDict Return Nothing Catch ex As Exception Throw ErrorHandler.LogWrite(si, New XFException(si, ex)) End Try End FunctionHope this helps
Sam