Forum Discussion

fc's avatar
fc
Contributor
21 days ago
Solved

Get the name of the current container of an embedded dashboard

Hi everyone,

In a dashboard that I'm developing I have multiple dashboards embedded into one another.

Within one of the embedded dashboards I have a button that is associated to a dashbaord extender rule. When the button is clicked, I need the rule to retrieve the name of the dashboard that is currently the container of the embedded dashboard where the button is placed (see scheme below)

Primary dashboard
               Embedded 1
                              Embedded 2
                                             Embedded 3
                                                  -> button

I see there are two  rules (args.PrimaryDashboard and args.EmbeddedDashboard) that allow to retrieve the name of the primary dashboard OR the name of the current dashboard (Embedded 3 in the example).

I need to retrieve the name of Embedded 2. I couldn't find any resource that explained if and how to do that.

Does anyone know how to do that?

Thank you

  • Hi fc​

    So it sounds like you are ultimately trying to identify the calling button?

    If so there is an easier way... In the component service or dashboard extender br you can get the Name of the component calling the rule from DashboardExtenderArgs e.g to retrieve name property we would use 

    args.ComponentInfo.Component.Name

    This will correlate to each of your buttons in your tabbed dashboard layout and you can pivot your condition based on this

    If you want to reduce components you could approach this using dynamic dashboards and the same trick with retrieving the button properties via args

    Hope this helps

    Sam

3 Replies

  • fc's avatar
    fc
    Contributor

    Hi sameburn​ 

    I'm setting up the following dashboard

    it will have multiple tabs (15-20 approx), each showing a different table and each giving the user the possibility of uploading from csv the table of the tab currently selected.

    In order to avoid creating 15-20 buttons, one per each tab, I was thinking about reusing the same button for all the tabs, and use a parameter to pass the name of the table that will have to be overwritten when the user clicks on the button in any of the tabs.

    The name of each tab will be equal to the name of the corresponding table in the db, so by retrieving the name of the tab (aka the name of the dashboard containing the button that was clicked AND the table below it) I would be able to overwrite the correct table in the db.

    The problem is, if I use args.PrimaryDashboard I get the name of the primary dashboard that contains everything else, and I have no use for it. If I instead use args.EmbeddedDashboard I get the name of the embedded dashboard that contains the button, which is the same for all tabs and corresponds to the horizontal banner above the table in the screenshot.

    I would need to get the name of the container of the horizontal banner above the table in the screenshot.


    I hope I was clear enough, please let me know if you have any suggestions or alternative paths for doing that!

    thank you

    • sameburn's avatar
      sameburn
      Icon for OneStream Employee rankOneStream Employee

      Hi fc​

      So it sounds like you are ultimately trying to identify the calling button?

      If so there is an easier way... In the component service or dashboard extender br you can get the Name of the component calling the rule from DashboardExtenderArgs e.g to retrieve name property we would use 

      args.ComponentInfo.Component.Name

      This will correlate to each of your buttons in your tabbed dashboard layout and you can pivot your condition based on this

      If you want to reduce components you could approach this using dynamic dashboards and the same trick with retrieving the button properties via args

      Hope this helps

      Sam