Default Value of a Delimited List Parameter Not Working

VENKAB05
New Contributor III

Hello Everyone,

I am using a Delimited List Parameter which results a list of comma separated values from SQL through XFBR.

When i use this parameter in Dashboard, it always shows as blank when it starts up, even though i have set the default value property.

Looks like its a limition at this point of time.

Are the any alternate ways we can use the default value for Delimited List Parameter in Dashboards ?

9 REPLIES 9

Sudhakar
New Contributor II

JackLacava
Community Manager
Community Manager

Default values can be a bit funny, because of quirks with how they're (not) populated when the list of choices is not known at the very beginning.

One workaround is to have an extender running at dashboard load, pushing a default value directly in the parameter.

Hi Jack,

Thanks for this comment - I'm having this exact problem! Do you happen to have (or has anyone else listening) any example code for a dashboard extender that would push a value into a parameter?

I've been using the following which is essentially using the brapi.dashboards.SetLiteralParameterValue command but I've found it doesn't always work. In fact I believe I might have misunderstood the basic function of this code as what it seems to do is populate the "Default value" of a parameter rather than the actual value assigned to it (the latter is what I'm trying to do).

Any suggestions would be welcomed!

Regards,
Richard

Richard_Mayo_0-1700840272143.png

 

Hi Richard,

VENKAB05_1-1700842767798.png

VENKAB05_2-1700842803971.png

The above 2 screenshots might help you.

I followed similar to above and i was able to get the default value.

Balaji V

That's great! Thanks for the quick response. I have had some success now with the new code, so thanks for clearing that up!

I also found quite a useful article here in case anyone else was interested but it's similar to the code you suggested.

Stop confusion with empty parameters in Dashboards - OneStream Community (onestreamsoftware.com)

Thanks again,

Richard

ChristianW
Valued Contributor

In the past, I also used xfbr to create comma separated lists for Delimited List Parameters. I did it to overcome problems I had with dynamic Bound List Parameters, if they needed parameters to query the database as well.

The error was caused because the custom parameter dictionary was not yet populated. To avoid the problem, you just need to test, if the custom parameter dictionary has data, before you run your code.

I‘m not at my desk, I will post a sample Monday.

And here is the code sample:

For Each paramValue As String In args.NameValuePairs.Values
	If StringHelper.DoesStringHaveCustomSubstVars(paramValue) Then Return Nothing
Next

You have to place it after this

Case Is = DashboardDataSetFunctionType.GetDataSet

and before any other if or select statementIf any argument contains unresolved parameters, it won't continue.

I hope this helps and cheers

 

VENKAB05
New Contributor III

Thanks a lot Christian.