Dashboards & Visualizations

How to have dropdown menus appear?

RylanBodrigueC
Engager
 

Hi everyone,

My goal here is as follows: based on which option the user chooses from the first dropdown menu,  a corresponding dropdown menu will appear. And the panels & graphics below will have queries based on the value passed from the second dropdown.

In other words, if I choose the TI40 from the first dropdown menu, then only the dropdown associated with it - the one that has 'depends=$show_ti40$"' - should appear. And a value chosen from the latter will influence the panels and graphics.

But this isn't really working. When I choose TI40, the dropdown menu for it does not appear. It only works as expected for ZV60 works.

What am I doing wrong? Or is there a better way to do it?

Screen Shot 2023-02-17 at 1.57.22 PM.png

Labels (3)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

Look at this with the <change> element

<form>
  <label>VarDD</label>
  <fieldset submitButton="false">
    <input type="dropdown" token="appCode">
      <label>Choose appcode</label>
      <choice value="ti40">TI40</choice>
      <choice value="zv60">ZV60</choice>
      <choice value="mqp0">MQP0</choice>
      <default>ti40</default>
      <change>
        <eval token="show_ti40">if($value$="ti40", "true", null())</eval>
        <eval token="show_zv60">if($value$="zv60", "true", null())</eval>
        <eval token="show_mqp0">if($value$="mqp0", "true", null())</eval>
      </change>
    </input>
  </fieldset>
  <row>
    <panel depends="$show_ti40$">
      <html>
        ti40 IS ON
      </html>
    </panel>
    <panel depends="$show_zv60$">
      <html>
        zv60=ON
      </html>
    </panel>
    <panel depends="$show_mqp0$">
      <html>
        mqp0=ON
      </html>
    </panel>
  </row>
</form>

 

RylanBodrigueC
Engager

Hi,

I see, so that's how it would work with panels. In a similar way, how could if I make subsequent dropdown menus appear based on input from the first dropdown menu?

Thanks

0 Karma

bowesmana
SplunkTrust
SplunkTrust

depends="$token$" syntax can be used on many elements, row/panel/input/search, so just set/clear tokens as necessary in your set/eval token setter statements to show hide the elements you want - you can be as dynamic as you like.

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @RylanBodrigueC,

for my knowledge, you can use the depends on option only for panels not for inputs.

But you can pass the token from the first input to the second one.

Please, next time, share you code in the "Code Sample" panel, not as screenshot because it is un'useful.

Ciao.

Giuseppe

Get Updates on the Splunk Community!

Data Management Digest – November 2025

  Welcome to the inaugural edition of Data Management Digest! As your trusted partner in data innovation, the ...

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...