Sync Tableau User/Group Permissions with Metric Insights by Using Custom Script

There's a possibility to synchronize content access in Tableau with Tableau content that exists in Metric Insights by running a Custom Script. This way, users/groups who have access to content in Tableau will be given access to the same content in Metric Insights, provided that content is recreated in the system.

The high-level procedure is comprised of the following steps:

  1. Import the Tableau permissions Workbook
  2. Update Data Source connection
  3. Publish Workbook
  4. Build the permissions Dataset
  5. Build the derived Dataset
  6. Build a Custom Script and validate it
  7. Build a Notification Schedule

PREREQUISITES:

NOTE: It is also possible to use the same Custom Script to:

  • Create Groups that don't exist in Metric Insights
  • Synchronize Users and Groups (which Users belong to which Groups)
  • Map Elements to users Favorites folder

1. Import Tableau Permissions Workbook

From Tableau, import the pre-configured Permissions.twbx file

Find the file attached below:

2. Update Internal Data Source Connection

  1. In the Edit mode, access a drop-down next to the database name
  2. Click Edit Data Source
    • This will open a new window.
  3. Access a drop-down next to the connection name
  4. Select Edit Connection
  5. Sign in to the internal database by providing the required credentials

3. Publish Workbook

  1. Select Publish > Publish As...
  2. Give the Workbook a Name
  3. Select Location to publish
  4. IMPORTANT: Enable Embed password for data source
  5. [Publish]

4. Create Permissions Dataset

Access +New > Dataset > Create Dataset

  1. Input a descriptive phrase in Name
  2. Specify Category to place the Dataset 
  3. Select the Tableau Data Source for which you want to sync Permissions
  4. Specify Data collection trigger that will be used to collect data for Dataset
  5. Select the Tableau Worksheet that that you have previously imported to Tableau
  6. [Validate]

Note the Dataset ID to be used at Step 5.

5. Build Derived Dataset

Access +New > Dataset > Create Dataset

  1. Input a descriptive phrase in Name
  2. Specify Category to place the Dataset 
  3. Select "Dashboard DB" as Data Source
  4. Specify Data collection trigger that will be used to collect data for Dataset
  5. Input the custom SQL statement from the attachment below, where:
    • dashboard_dataset.dataset = Dataset ID from Step 4
  6. [Validate]

Note the Dataset ID to be used at Step 6.2.

6. Configure Custom Script

NOTE: The Custom Script file must be requested at [email protected].

  1. Enable the Custom Script
  2. Set Custom Script is to "enabled"
  3. Choose External Application
  4. Set Are Parameters Required to "Yes"

6.1. Add Parameters

Add Parameters according to the list specified in the Custom Script file (requested from our support).

6.2. Add Parameter Set

  1. [+Add Parameter Set]
  2. Input a descriptive phrase in Parameter Set Name
  3. Enter the Dataset ID from Step 5 in masterElementsDatasetID
  4. [Save]

6.3. Insert Script

  1. Insert the Custom Script from the file (requested from our support) under the Editor Tab
  2. [Run Script] to verify it executes successfully. This will also save your changes.

7. Create Notification Schedule for Custom Script

Access Admin > Distribution > Notification Schedules > [+New Notification Schedule]

  1. Set Frequency to "on certain days of the week".
    • It is recommended to set the Schedule to be executed daily, but you can choose your own frequency.
  2. Provide a descriptive Schedule name
  3. Set Notification Schedule is to "enabled"

7.1. Associate Script with Notification Schedule

  1. Under Run Scripts, click [+Add Script]
  2. Choose Script name
  3. Specify Parameter set
  4. [Save]
  5. [Save] all changes