cancel
Showing results for 
Search instead for 
Did you mean: 
intapiuser
Community Team Member
Community Team Member
Download: Auto Filter
Introduction
This article explains how to automatically add a dashboard filter, based on the logged in user.
Purpose/Benefits
In order to provide a better user experience, you may want to automatically set a filter on your dashboards based on the logged in user.  This plugin checks the dashboard as it loads and looks for any filters that match the Elasticube.  If it finds any in the config file, it uses the user's email address to find a selection value and adds the filter automatically
Step 1 - Add The Plugin
Download the attachment and unzip the contents into your C:\Program Files\Sisense\PrismWeb\plugins\ folder. If you are using version 7.2 and higher unzip the contents into your C:\Program Files\Sisense\app\plugins\ folder. If the plugins folder doesn't exist, just create it. After those files have been unzipped there, you may also have to restart the web server. 

STEP 2 - CONFIGURE THE PLUGIN

Open the config.js file to manage the auto filters.  There is a config variable, which contains a list of the filters to add. Each filter should include the following properties
  • server - the server of the Elasticube (in case of remote Elasticube servers)
  • elasticube - the name of the Elasticube this filter applies to
  • filter - the filter that will be added to the dashboard, this object has dimension ([Table.Column]), datatype, and title as properties
  • queryMatch - the field that will match the logged in user's email, you need to specify the dimension and datatype
  • querySelection - the field to query for, the values we get back will be added to the dashboard filter
  • type - can be "first" or "all", determines what to do with multiple results from the query (use only the first result or multi-select all of them)

EXAMPLE

Based on the Elasticube below, we want to get the logged in user's ID from the Users table and add a filter for the API Calls table
// Define config settings
var config = {
"maxResults": 50,
"filters": [
{
"server": "localhost",
"elasticube": "Sisense Usage",
"filter": {
"dim": "[API Calls.userId]",
"datatype": "text",
"title": "User ID"
},
"queryMatch": {
"dim": "[users.email]",
"datatype": "text"
},
"querySelection": {
"dim": "[users._id]",
"datatype": "text"
},
"type": "first"
}
]
}

NOTES/REFERENCE

  • In order to match the logged in user with the filter, you must use the email as it's the only unique identified for users in Sisense
Rate this article:
Version history
Last update:
‎01-22-2024 06:53 AM
Updated by: