Dashboard - Passing Filter Values Using URL Parameters
Published 06-09-2022
[EDIT] If you have any spaces or other special characters in the filter member names that get encoded when passed in the URL, use the following dashboard script:
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]) })
prism.activeDashboard.filters.$$items.forEach(function(fil) {
if (parameters.get(fil.jaql.title) !== undefined)
{
fil.jaql.filter.explicit = true
fil.jaql.filter.userMultiSelect = true
fil.jaql.filter.members = [parameters.get(fil.jaql.title)]
}
})
})
Hello Anonymous,
Can you share example link where filter name and result have spaces? How to generate the dashboard link for such case?
Can we also doe multiple selected result? If so, can you share sample link as well?
Thanks