On dashboard get selected value of an interactive filter using JS to use in a report condition

Brian Whyte
Kilo Guru

I'm trying to provide a solution to the following. 

 

"Jane Doe manages 60 itil workers and wants a dynamic dashboard that she can use to select any one of the 60 workers and view the reports on that dashboard geared to the user she's evaluating.  Recently, Joe Admin created a dashboard with performance metric reports that updates the reports in the dashboard based on whoever is accessing the dashboard, but this dashboard doesn't allow users to view anyone but themselves unless they impersonate another user which isn't a privilege that is allowed to be handed out without reasonable cause. The hope is that the current dashboard can be updated so that there's a user selection at the top where the user accessing the dashboard can select whose metrics they want to see and then the reports update. " 

 

Ok, before you tell me to go look at Interactive filters, let me say that I have (I've even looked at custom interactive filters) and I've run into a couple of things that I feel I can't seem to get past because capability here seems limited.  Yes, interactive filters seem to be the go-to solution, but I'm having a lot of difficulty achieving a robust solution with them.  First, I've noticed that they only support AND, and once one is defined in a dashboard and the reports are set to follow the interactive filter, the same conditional criteria is added to every report.  That's less than ideal for a lot of different types of reports.  Yes, it works if things are really simple, but I've found that for my scenario that doesn't work because my reports are a bit more complex than that and I need to use the value selected across multiple fields.  Here are the questions I have.  If there are a lot of different reports and instead of "Assigned to = [Interactive Filter Selection]" being added to every report, what if some of the reports need "Assigned to = [Interactive Filter Selection] OR Updated by = [Interactive Filter Selection]" and finally some of the reports just need "Opened by = [Interactive Filter Selection]" and don't use Assigned to or Updated By at all.  Seems like there's not a good solution for this other than to create a bunch of tabs and put one report on each tab which isn't ideal not only because it's a lot of tabs to look at but also because now the user has to re-select the user in every tab they look at.  In my organization, time is really important and people don't want to have to click through 10 tabs to get a performance picture that could be summarized on one tab in clean concise view with like 20 good reports or varying types laid out in a pleasing manner.

 

As I mentioned, the other option seems to be to abandon Interactive Filters and then just use impersonate user to view the dashboard in regards to person it needs to be seen as.  Impersonate user seems like a really bad solution though because it grants privs that I feel most people should not have.  I'm looking for other ideas.   

 

If I was to suggest, the way I feel this would be much more functional is if the report conditionals included some additional dynamic options to take the Interactive filter value into account... For example, when I define my condition, when I choose Assigned to is (dynamic) and then within the dynamic option list that pops up, there would be a selection "Use Selected Interactive Filter Value".  I tried creating a dynamic filter option to do this very thing, but I have no clue how to get the currently selected value of the Interactive filter through JavaScript. I tried DOM stuff like Assigned to contains javascript:document.getElementbyId("select2-chosen-3").innerHTML;  Seemed plausible, but it didn't work at all. If there's a way to navigate glide to get the value the user has selected in the Interactive filter, I haven't had any luck finding it in the API. 

 

Am I missing something, can this be done?  It seems like building a dashboard like this would be fairly common.  Sorry, I'm long winded. I thought about asking ChatGPT...

 

3 REPLIES 3

Dominik11
Tera Contributor

Hi, did you find a solution for this? I also need to get values from interactive filters.

 

jfuasid
Tera Contributor

I'll third looking for a solution.

M Talha
Tera Expert

Hi @Brian Whyte 
I think by leveraging client scripts, dynamic report conditions, and possibly custom UI components, you can build a more efficient and user-friendly dashboard that meets the needs of both Jane Doe and her team.

This approach avoids the pitfalls of impersonation and provides a streamlined experience for selecting and viewing performance metrics.
If this is helpful for you, please mark it as helpful and don’t forget to leave your comments!
Regards,
Muhammad Talha