cancel
Showing results for 
Search instead for 
Did you mean: 

Auto Filter on current user

andrew
8 - Cloud Apps
8 - Cloud Apps

Hi all,

I found this plugin which looked like it would do what I wanted:

Auto Add Filter Based On User - Sisense Support Knowledge Base

However I don't seem to be able to get it to work with our version? Does anyone know if this code is still current and if there is another way to grab the current logged in users email and pass to the dashboard filters?

Thanks

Andy

 

2 ACCEPTED SOLUTIONS

harikm007
13 - Data Warehouse
13 - Data Warehouse

Hi @andrew ,

Try this dashboard script. (here update the variable filterName with name of your dashboard filter)

dashboard.on('initialized', function (se) {
	let filterName = 'User Filter' //change this name with your dashboard filter name

	selectedFilter = se.filters.$$items.find(el=>el.jaql.title == filterName)
	
	if(selectedFilter)
	{
		selectedFilter.jaql.filter = {
									"explicit": true,
									"multiSelection": true,
									"members": [
										prism.user.email
									]
								}
	}

})

-Hari

 

View solution in original post

Thanks Hari - worked like a Charm.

View solution in original post

2 REPLIES 2

harikm007
13 - Data Warehouse
13 - Data Warehouse

Hi @andrew ,

Try this dashboard script. (here update the variable filterName with name of your dashboard filter)

dashboard.on('initialized', function (se) {
	let filterName = 'User Filter' //change this name with your dashboard filter name

	selectedFilter = se.filters.$$items.find(el=>el.jaql.title == filterName)
	
	if(selectedFilter)
	{
		selectedFilter.jaql.filter = {
									"explicit": true,
									"multiSelection": true,
									"members": [
										prism.user.email
									]
								}
	}

})

-Hari

 

Thanks Hari - worked like a Charm.