Dashboards & Visualizations

Reset token value to it's default value on click of a reset button

mnj1809
Path Finder

Hello,

I want to reset all the filters values to reset back to their default values when the Reset button is clicked. I tried a lot using JS but it's not working.
Thanks in advance for your help

@ITWhisperer 

 

Labels (1)
0 Karma

bandit
Motivator

Right, it's a workaround and does reload the dash, but it will clear the tokens as long as link back to the base of the app and include no arguments in your link. See below.
Example where I used this in one of my dashboards. 

bandit_0-1655409716101.pngbandit_1-1655409836910.png

 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @mnj1809,

insert the following input:

  <fieldset submitButton="false" autoRun="false">
    <input type="radio" token="resetTokens" searchWhenChanged="true">
      <label></label>
      <choice value="reset">Reset Inputs</choice>
      <choice value="retain">Retain</choice>
      <default>reset</default>
      <change>
        <condition value="reset">
          <unset token="token1"></unset>
          <unset token="token2"></unset>
          <set token="resetTokens">retain</set>
        </condition>
      </change>
    </input>
  </fieldset>

Ciao.

Giuseppe

mnj1809
Path Finder

Hello,

Thanks for your quick response but my requirement is to reset filters to their default values on click of a "BUTTON".

@gcusello 

0 Karma

bandit
Motivator

I've wanted this functionality as well.  @mnj1809 here's a workaround which is essentially creating an html link back to the same dashboard. https://community.splunk.com/t5/Getting-Data-In/Reusable-Script-Reset-All-Tokens-with-a-Single-Click...

Rob

0 Karma

mnj1809
Path Finder

Hello Bandit,

The link you provided is for refreshing the dashboard and not for resetting the filters.

@bandit 

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...