andrew
02-10-2023Cloud Apps
Auto Filter on current user
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
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.