Overview:

This guide explains how to apply filters to a subject (dataset) based on data associated with the user. This allows each user to only see data relevant to them when accessing the subject, using values defined in a user data table and linked to their profile (e.g. region, business unit, team, etc.).


This is useful for ensuring data visibility aligns with user roles or access levels, especially in multi-tenant environments or role-restricted datasets.


Step 1: Define User Profile Values
To achieve this, we first need to define the data that is associated with each user. We do this by publishing a dataset that contains the user data. This dataset must have the following characteristics: 

  1. The dataset must contain a row for each user defined in inmydata
  2. The dataset must include a column that contains the user id matching the user id defined in inmydata
  3. The dataset must include a column for each value you wish to be associated with each user.


Once the dataset containing the user data is loaded, you need define it as the user data subject. Follow these steps:


  1. Log in to inmydata using an account with admin rights.

  2. From the user menu (top right icon on the screen), select Settings.

  3. Select the Users tab in the left panel.

  4. Under User Subject, select the dataset loaded above.

  5. Under User Id Field, select the column that contains the user id.

  6. Press OK to save the changes.



Step 2: Enable Subject Filtering

  1. From the Settings menu, select Edit Subjects.

  2. Choose the subject (dataset) you want to edit and click the Edit button 

  3. Select the Filter tab.

  4. Check “Add a filter to limit the data available to users.”


Step 3: Define the Filter Logic

  1. Click Add Filter.

  2. Choose the field in your subject you want to filter (e.g. Region, Sales Territory, etc.).

  3. In the comparison dropdown, select “=”.

  4. Select the option [A value related to the current user]

  5. In the value dropdown, select the corresponding user profile key (e.g. {{user.region}}).

  6. Save the filter.

? This filter is now applied globally to the subject, so every visualisation or dashboard using it will respect this restriction.