Dynamically setting the bound parameter for a Supplied Parameter

Pplant
New Contributor III

Is it possible to dynamically set the Bound Parameter of a Supplied Parameter?

I have tried to use and xfbr rule to do this but the supplied parameter but this does not work.

14 REPLIES 14

JackLacava
Community Manager
Community Manager

You will likely need a Dashboard Extender Rule to modify Parameters - as long as you just want to set values, that will work. Look into the properties of the *TaskResult objects, there are properties like ChangeCustomSubstVarsInDashboard and ModifiedCustomSubstVars that should allow you to do that.

If you've tried that already, we might need more info - maybe post the rule and/or relevant screenshots showing the Parameter config.

Pplant
New Contributor III

Hi Jack,

Thanks for the input. However, the variables that you mention change the value of the parameters and not the bound parameter that is assigned to the supplied parameter dashboard component. (I am already using this to update the values of other parameters).

Pplant_0-1665137223397.png

The supplied parameter references another parameter. I would like to dynamically change the name of the parameter that is referenced. In this case the SWD_copyIDs parameter is being referenced. I would like to change this to another parameter.

Using a supplied parameter in a dashboard means that the value of the referenced parameter can be used in the dashboard (and this will be in the dictionary args.SelectionChangedTaskInfo.CustomSubstVars ... and the other args variables). This is what I would like to achieve because then I can set the value of the parameter.  

Not sure what you are trying to achieve. We might be able to provide ideas if you can describe what you plan to do with it. Launch another dashboard or something else?

db_pdx
Contributor III

If you need to reference a different parameter in the dashboard, you should add that parameter to its own supplied parameter.

If you want to change the value that has been assigned to SWD_copyIDs, just change the value within your BRs using the options mentioned or SetLiteralParameter

Think of supplied parameters as a way to tell the dashboard, "hey, I want you to know the parameter within me is available to you"

Pplant
New Contributor III

Thanks for the input. However, I would like the assignment of the Supplied Parameter to be dynamic, i.e. the Supplied Parameter will exist in the dashboard with the name Param01 but the Bound parameter that this has will be set dynamically, that is at run time. And that this assignment will vary based on user and session (based on other selections that the user has made). 

I am trying to set up a dashboard that will render user input forms and dashboards. The Forms will use have user selections that can be set at run time. I am not aware of any way to dynamically add components to a dashboard at run time that will just impact the current session. So, my ideas is to have some place holder parameters and to assign these to parameters at run time. For the parameter to be available in the dashboard I need the supplied parameter to be set (unless there is a different option. )

Henning
Valued Contributor

Hi, did you try using a Load Dashboard Server Task? This one runs when the dashboard is opened and you should be able to apply user-specific parameters to the dashboard. This refreshes each time the dashboard is loaded. 

Henning_0-1665391636353.png

 

Pplant
New Contributor III

Hi Henning. Yes, I am using the on load task and also on component change. However, I have not found anywhere to set the bound parameter for a supplied parameter. 

Not sure why you are thinking of supplied parameter only. The reason why I asked you to describe what you are trying to achieve is to provide different options. You cannot dynamically add components to the dashboard on the fly, so the usual idea is to use an embedded dashboard with parameters and set parameters on the fly. If you look at most of the navigational-type solutions (like People planning), that is how it is implemented. The other option is to add all the objects and then use the IsVisible option to hide them. However, the problem with this approach is the space taken by the components cannot be redistributed. (I might have seen some whether you set the width of the object to a 0 and reclaim the space, but it is complex compared to the embedded dashboard approach)

Pplant
New Contributor III

Thanks for the input. Unfortunately, it looks as though what I would like to do is not possible. The reason that I am thinking about supplied parameters is that this would allow parameters to be added to the dashboard at run time. I could have a number of supplied parameters set up in the dashboard and then assign these to the supplied parameters and also to selection components such as buttons (member select) or combo boxes by assigning the bound parameter to these. The reason that I would like to do this in a more dynamic way is that as new cube views and dashboards get added to the application these could be added to the "Form Manager" without having to add anything to the Form Manager dashboard. 

I'll try to add a better description of what I am trying to achieve. Like you mentioned earlier there are probably other (better) approaches to this. 

JackLacava
Community Manager
Community Manager

@Pplant wrote:

I am not aware of any way to dynamically add components to a dashboard at run time


Embedded Dashboards components have a property Embedded Dashboard, which can be set to a Parameter. You can then manipulate that parameter in various ways (including the one @Henning mentioned) to specify the name of a different Dashboard to embed, hence loading different controls if required. You will have to refresh or reload the dashboard embedding that component, after the parameter is changed, in order to trigger redrawing of the Embedded Dashboard.

Note that you can create your own Embedded Dashboard component like any other Component, you are not limited to the ones that get created when you create Dashboards.

Pplant
New Contributor III

Hi Jack. Yes, you are correct. But I think that I was a little unclear. I really meant to dynamically add a new component at run-time, such as adding a new supplied parameter to a dashboard, or a new button. I do not mean making a component visible or referring to an already existing component such as a dashboard. 

I've done adding a component dynamically. However, the problem is with the Dashboard cache, I couldn't find a way to refresh the cache other than restarting IIS. However, that cannot be used as a solution. 

Pplant
New Contributor III

Yes, that sounds like a problem. Was the component added only for a specific session or was this added for all users?

Out of curiosity, how did you add the component? was this by updating the Dashboard* tables or could you do this via the api?

JackLacava
Community Manager
Community Manager

I'm sure you can get clever with Parameters so that you don't need new Supplied ones (which, tbh, are kinda redundant). A Literal parameter, for example, could contain a list of key-values to parse with NameValuePair, or even a JSON structure, that you can then unpack via XFBR where required.

Adding new Components, yeah, i'm not aware of ways to do that; the main technique is to have everything you might need ready on hidden dashboards, and display (or pop-up) them as necessary. If you think you might want to do something like generating a long list of elements with controls attached (e.g. a button for each member), you can either drop their names in a Combobox/Listbox instead, or use a CubeView and use Bound Parameters (in Navigation Links) to automatically create and populate the params you need.

Maybe if you attach some sort of screenshot or layout to explain what you want to achieve more in detail, we might be able to suggest something more specific.