Knowledge Base Article
Hi Anonymous ,
I'm trying to implement this solution so I can have preset filters via dashboard urls for ease of navigation through multiple dasboards.
It appears that certain filters in the url will not pass through to the dashboard, particularly if the filter has "Include all" already preselected and default set on the dashboard.
Upon further investigation, if the filter of interest has an option selected, then the url will pass through the filter.
Is there anyway to enable the filter via url to pass through regardless of the data currently filtered on or not?
- mgkirsch04-03-2023Cloud Apps
try adding fil.jaql.filter.all = false
dashboard.on('initialized', function(widget) { // Get Parameters urlParameters = decodeURIComponent(window.location.href.substring(window.location.href.indexOf('?')+1)).split('&'); // Parse Parameters parameters = new Map(); urlParameters.forEach(function(param) { parameters.set(param.split('=')[0],param.split('=')[1]) }) console.log(prism.activeDashboard.filters.$$items) prism.activeDashboard.filters.$$items.forEach(function(fil) { if (parameters.get(fil.jaql.title) !== undefined) { fil.jaql.filter.all = false fil.jaql.filter.explicit = true fil.jaql.filter.userMultiSelect = true fil.jaql.filter.members = [parameters.get(fil.jaql.title)] } }) })
- irismaessen03-17-2023Data Pipeline
Hello Milan,
(With the motto of better late than never)
Are you aware of the *regular* method of passing Dashboard filters?
You can always include the filter JAQL in the embed url, and set filters that way.
That article says to URL encode it, in my experience that is not always necessary (only if you have free text filters IME).
The filter JAQLs JSON.stringify retrieves using the above method is much bigger for me than the example in the article, and many of the components of the JAQL can be stripped (after some experimentation to check that the filter is still working, of course). But it *does* work.