Set up initial filter values for embed dashboard.

Rodrigo Mercado shared this question 4 years ago
Answered

Hi Team,

I'm trying to set up an embed dashboard with initial filter values for version 8 as shown in the last example of this doc:

https://wiki.yellowfinbi.com/display/user80/Advanced+Use


The dashboard and the filters work. However, the filter values don't load.

Tried using the Yellowfin Database as source to bypass other authentications, and using the 'siadmin' user.

The 'Yellowfin.log' shows the following errors

BMC:SR:2020-03-30 11:55:09:DEBUG (JsAPI2DashHandler:handleRequest) - User is not logged in

BMC:SR:2020-03-30 11:55:09:ERROR (JsAPI2DashHandler:handleRequest) - Error loading filters: com.hof.mi.jsapi.JsAPI2DashHandler$_A

com.hof.mi.jsapi.JsAPI2DashHandler$_A


Have you seen this problem before?


Attached is the script used and the log of just the replicated issue in DEBUG.

Best Answer
photo

Hi Rodrigo,


Apologies for the delay in this. Having looked into this, it appears our example code on the wiki is incorrect. To get the filter to work please try replacing the individual filter assignments as follows:


filterValues[encodeURI(filters[i].key)] = 'Dashboard Consumer';

The addition of the encodeURI function should fix the issue as it looks like the | character is no longer being URL encoded by default. I have reached out to our technical writers to update the documentation accordingly.


Please let me know how you go with this and if you run into any more issues.


Cheers,

Neal

Replies (1)

photo
1

Hi Rodrigo,


This is not something we have seen before. Can you please provide some more detail on the type of dashboard and the filters used so we can look to replicate this issue? Can you also expand on the filters work but the values don't load? Do you mean that you are able to apply the default filter value but when you open the filter you are unable to see that value in the filter box? Or do you mean that the filter is entered/selected correctly by the dashboard does not respond to the filter values?


Can you also confirm which build version of smart reporting you are using so I can test on the same?


Cheers,

Neal

photo
1

Hi Neal,

Thank you for the prompt response. Regarding the functionality of the filters, the filters work in the sense that, I'm able to manually select any filter in the embed dashboard, however, the functionality to preload filter values (Open the dashboard with predefined filter values defined in the script) doesn't work.


For this test, I'm using the User Dashboard, from the OOTB Smart Reporting Audit reports, using the filters 'Role' and 'Client Org', for the values 'Dashboard Consumer' and 'sr1908' (the name of the main organization for single tenancy environment). Using the Smart Reporting Repository database as the source.


However, I've used a remedy data source with the same problems, wanted to limit the amount of variables to make it simpler, that's why i'm now testing with the above.

The Smart Reporting version is 19.02 (v8), I've also tested with the same results in 18.05(v7.3)

The database is MS SQL 2016.


I've attached a second script with the specific filter values.

photo
2

Hi Rodrigo,


Apologies for the delay in this. Having looked into this, it appears our example code on the wiki is incorrect. To get the filter to work please try replacing the individual filter assignments as follows:


filterValues[encodeURI(filters[i].key)] = 'Dashboard Consumer';

The addition of the encodeURI function should fix the issue as it looks like the | character is no longer being URL encoded by default. I have reached out to our technical writers to update the documentation accordingly.


Please let me know how you go with this and if you run into any more issues.


Cheers,

Neal

photo
1

Hi Rodrigo,


Hope you are doing well. I wanted to see if you had any success with the code changes I sent through? Was there anything else you needed on this?


Cheers,

Neal

photo
1

Hi Dennis,


The final user was able to apply the filters successfully.


Thank you,

Rodrigo

photo
1

Hi Rodrigo,


That is great to hear. I will mark this as completed and please do let me know if you run into any more issues.


Cheers,

Neal

photo
Leave a Comment
 
Attach a file