Lisha
10-04-2022Cloud Apps
Dashboard Filter
Hi,
I had a requirement to set my Dashboard date filter to have end date as today and this should be the default filter. (eg. 1 Jan 2022 to today)
I found below script that does the job of setting today as end date dynamically.
Now, if I set this as default filter manually today (1 Jan 2022 to 4 Oct 2022); it will still be the default filter tomorrow unless I manually set it to tomorrow's date. I want the default filter to be reset dynamically as well. It should always be <start date> to today.
Is there a way to achieve this ?
Hi Lisha ,
Try this script along with existing dashboard script.
dashboard.on('filterschanged', function (se, ev) { if(ev.items[0].jaql.title == 'As Of Month') { let today = new Date() let todayParsed = parsedDate = today.toISOString().substr(0,10) ev.items[0].jaql.filter.to = todayParsed } });-Hari