Help & DocumentationGetting DataWorking with TableauCreating ContentSync Tableau User/Group Permissions with Metric Insights by Using Custom Script

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. Build the permissions Dataset
  4. Build the derived Dataset
  5. Build a Custom Script and validate it
  6. Build a Notification Schedule

PREREQUISITES:

  • Established connectivity with the required Tableau Data Source
  • Custom Script file requested from [email protected]

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. 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 4.

4. 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 3
  6. [Validate]

Note the Dataset ID to be used at Step 5.2.

5. 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"

5.1. Add Parameters

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

5.2. Add Parameter Set

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

5.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.

6. 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"

6.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