Splunk Search

Dependent Dropdown eroor

ajitshukla61116
Path Finder

Hello all,
I have 2 dropdown one is parent dropdown and other is the dependent child dropdown.
dropdown1 has values-a,b,c
dropdown2(child dropdown)- is hidden and gets unhidden when user select b value of dropdown 1

Now the scenario is->
suppose dropdown2 has items->p,q,r in it (in which p is the default value and initial value)

when b is selected-> dropdown2 gets unhidden and shows the default value p
->now we change Dropdown2 value to q
now c is selected-> Dropdown2 gets unhidden (it is working correctly till now)

now b is selected again->now default value p should appear but last selected value q is getting selected.

Tags (1)
0 Karma

renjith_nair
Legend

@ajitshukla61116 ,

On the change event of parent while you are setting the token to display child dropdown, set the token of child dropdown to "p"

ie. <set token="form.child">p</set>

Here is the example

<form>
  <label>Dependent Dropdowns</label>
  <fieldset submitButton="false">
    <input type="dropdown" token="parent">
      <label>Parent</label>
      <choice value="a">a</choice>
      <choice value="b">b</choice>
      <default>a</default>
      <initialValue>a</initialValue>
      <change>
        <condition value="b">
          <set token="show_child">true</set>
          <set token="form.child">p</set>
        </condition>
        <condition>
          <unset token="show_child"></unset>
        </condition> 
      </change>
    </input>
    <input type="dropdown" token="child" depends="$show_child$">
      <label>Child</label>
      <choice value="p">p</choice>
      <choice value="q">q</choice>
      <default>p</default>
      <initialValue>p</initialValue>
    </input>
  </fieldset>
</form>

If this is not what you are looking for, please share the input part of current XML

---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma
Get Updates on the Splunk Community!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...