Dashboards & Visualizations

How to reset a text input to default when a drop-down input changes?

mbschriek
Explorer

Hi all,

In my dashboard, the user is able to select a specific location via a drop-down. Attached to these locations are text input fields which are filled in with default values:

<change>
        <condition value="location_1">
          <set token="default_limit">200</set>

When a user wants to change this default value, he/she can edit the text field and the actual used input for the panels will change.

<input type="text" token="text_limit" searchWhenChanged="true">
      <label>Limit (kWh):</label>
      <default>$default_limit$</default>
    </input>

Panels:

<panel>
      <single>
        <search base="sales">
          <query>| eval range>$text_limit$</query>
        </search>

However, when a user changes the drop-down location after manually adjusting the text input, the text input will remain the same instead of changing back to the default of the other location.

How can I fix this?

1 Solution

somesoni2
SplunkTrust
SplunkTrust

Change

<change>
         <condition value="location_1">
           <set token="default_limit">200</set>

with

<change>
         <condition value="location_1">
           <set token="text_limit">200</set>

and remove default from the textbox.

View solution in original post

0 Karma

somesoni2
SplunkTrust
SplunkTrust

Change

<change>
         <condition value="location_1">
           <set token="default_limit">200</set>

with

<change>
         <condition value="location_1">
           <set token="text_limit">200</set>

and remove default from the textbox.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...