Forum Discussion

Michael-Schram's avatar
Michael-Schram
Cloud Apps
11-04-2021
Solved

Set Dashboard Data Sources by User

Is there a proven method for having the Sisense web application dynamically set the data sources for a dashboard, at the time they are opened or at login, based upon the user accessing them?

We want to have a 1 to 1 relationship between clients and cubes and retain one dashboard instance that they can all access.  A single data source, with security filters, would be too large for our use cases.

  • Hi Michael,

    If your users are grouped then it should be possible with the Dynamic Elasticube Plugin .  This makes it possible to either choose the EC based on a URL-parameter or based on the GroupID. This is set in the config file. We use this plugin to let users from different customers use the same dashboard, but based on the group the user is in, another EC will be chosen each time

    Hamza

10 Replies

Replies have been turned off for this discussion
  • HamzaJ's avatar
    HamzaJ
    Data Integration

    Hi Michael,

    If your users are grouped then it should be possible with the Dynamic Elasticube Plugin .  This makes it possible to either choose the EC based on a URL-parameter or based on the GroupID. This is set in the config file. We use this plugin to let users from different customers use the same dashboard, but based on the group the user is in, another EC will be chosen each time

    Hamza

  • HamzaJ's avatar
    HamzaJ
    Data Integration

    Hey Amritha_B ,

    Something like this should work (atleast it does for me). Make sure the IDs and datasource names are correct.

     

    export const dynamicElastiCubeSettings = {
        // If you would like to use URL params, modify here.
        urlParamName: 'data',
        // Default behavior uses dashboard OID as security object key.
        // Disabling this option uses dashboard titles as security object keys.
        configureByDashOID: true,
        // If enabled, throws errors in console. Disabled by default.
        throwErrors: false,
        // Mask data if error occurs. Disabled by default.
        maskDataOnError: false,
        // Confirms the server location of an ElastiCube.
        // Enable if your ElastiCubes migrate between servers.
        verifyECLocation: true,
        // // Example security definition structure
        // // dashboardOID: (or title if configureByDashOID disabled)
        // // { userGroupId: elastiCubeTitle, ... } ...
        security: {
            '63f23282c0ccfb1af49a1a14': { //dashboard id
                '63ca109c5ce6523bd0aa4043': { //group id
                    dashboardDatasource: {
                        title: 'Org1',
                        address: 'LocalHost', // if the address doesn't exist, data source be chosen by default from localhost
                    },
                },
                '63ca0d3e7dce523bc0545bff': { //group id
                    dashboardDatasource: {
                        title: 'Org2',
                        address: 'LocalHost', // if the address doesn't exist, data source be chosen by default from localhost
                    },
                }
            }
        },
        // Will take latest ElastiCube and set it as dataSource.
        selectMostRecent: false,
        // Roles for which ignore ElastiCube updates.
        mostRecentRolesBlackList: []
    };
    
    

      

  • Hi can I get the exact steps of how to do it ?

    I have one system admin and 2 users. Sys admin is pointing to cube3. User1 is pointing to cube 1 and belongs to c?group1. User3 is pointing to cube2 and belongs to group3

    I created a dashboard as sysadmin and shared it to both the groups

    Is my expectation correct that since in the config I have pointed this dashboard to the user group with dashboard Oid . The users should be able to acces their own cubes and not the sys admins cube ?

    Please help, this isn't working currently 

     

     

     

     

     

     

     

     

     

  • HamzaJ's avatar
    HamzaJ
    Data Integration

    Hi Amritha_B ,

    That is the case. When correctly configured when a user of group A goes to the dashboard it will be loading datasource A and when a user of group B goes to the dashboard it will be loading datasource B. 

    If you can share the group IDs and dashboard IDs, I can help configure this correctly for you

  • '63f23282c0ccfb1af49a1a14': { //dashboard id

    '63ca109c5ce6523bd0aa4043': { //group id1

    '63ca0d3e7dce523bc0545bff': { //group id2

    dashboardDatasource: {
    title: 'Org1'

    dashboardDatasource: {
    title: 'Org2'

  • The sysadmin is making a dashboard from a different cube titled 'admin_cube'

  • hi hamza ! youre the best 

    thank you so much for the solution

    however, this looks like it always needs a refresh? is there anyway to avoid this ?

  • HamzaJ's avatar
    HamzaJ
    Data Integration

    Unfortunately not. As far as I know for every new dashboard, datasource, group you will need to edit this config file. Perhaps that one of Sisense's partners like Ravid_PaldiTeam or Ido_QBeeQ can create something that is more dynamic. I do not have anything atm

  • Thanks HamzaJ 

     

    Hi Amritha_B 

    I'm not sure what you mean by "always needs a refreash" as it from this thread it sounds like your use case is the plugin's stright forward use case but we've actualyl incoporated this plugin's functionality into our framework as we've done some custmization projects around it. 

    Most popular one can be read in this case study which involved dynmic custom UI, filters and few other things  that were determined at run time based on the logged in user.

    Search for the term "MyTeam" to quickly navigate to the relevent part of your use case: 

    https://www.sisense.com/success/logicbay 

     

    Feel free to reach out if you'de like to hop on a quick call to see what you mean and where we can assist as it seems that the dynamic elastic cube plugin should cover your need out of the box. 

    Looking forward,

     

  • When I login as sys admin and make a dashboard. I share it to two groups which are associated with two cubes

    So, when I login as user1 it is still pointing to sysadmins cube instead of his own cube ..but on page refresh, it points to user1's cube

    Is there anyway I can avoid the page refresh to view my dashboards ?