Reset to Default Filters Button using BloX

This article will explain how to create reset to default filters button in BloX
This helps in case you want to provide this iconmceclip0.png functionality on the dashboard and not just in the Filters panel.
resetfilters.gif
1. Create a new custom action with the below code: 
 *Make sure you're naming the action 'Click' if you're using the attached dashfile in section 2
1
2
var dashboard = payload.widget.dashboard
dashboard.filters.update(dashboard.defaultFilters,{refresh:true})
createaction.pngcodeaction.png
2. You can use the dashfile attached (Backtodefaultfilters.dash )
OR
Copy & Paste the below JSON code in the Editoreditor.png
1
2
3
4
5
6
7
8
9
10
11
12
13
{
 "style": "",
 "script": "",
 "title": "",
 "showCarousel": true,
 "body": [],
 "actions": [
 {
 "type": "Click",
 "title": "Reset Filters"
 }
 ]
}