Forum Discussion

Pplant's avatar
Pplant
New Contributor III
3 years ago

Dynamically setting the bound parameter for a Supplied Parameter

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.

  • JackLacava's avatar
    JackLacava
    Honored Contributor

    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's avatar
      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).

      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.  

      • db_pdx's avatar
        db_pdx
        Valued Contributor

        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's avatar
    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's avatar
      Henning
      Valued Contributor II

      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. 

       

      • Pplant's avatar
        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. 

    • JackLacava's avatar
      JackLacava
      Honored Contributor

      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's avatar
        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.