Dashboards & Visualizations

Dropdown visibility

Jasmine
Path Finder

i have three drop down lists. one with component(A,B,C,D). other dropdown with severity(Info,Warning) and colour dropdown list.

If i select A,Info - colour dropdownlsit should be shown
if i select B,Info - colour dropdownlist should not be shown.


how can i achieve this?

Labels (1)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

It's actually easy enough with a bit of inline CSS - see this simple XML dashboard example, which hides the colour dropdown and sets the colour to black. If you select A, C or D then the colour dropdown is re-shown.

<form version="1.1" theme="light">
  <label>ddl</label>
  <fieldset submitButton="false">
    <input type="dropdown" token="component" searchWhenChanged="true">
      <label>Component</label>
      <choice value="A">A</choice>
      <choice value="B">B</choice>
      <choice value="C">C</choice>
      <choice value="D">D</choice>
      <change>
        <eval token="display_colour">if($component$="B", "display:none", "")</eval>
        <eval token="colour_name">if($component$="B", "No Colour", $colour_name$)</eval>
        <eval token="form.colour">if($component$="B", "#000000", $form.colour$)</eval>
        <eval token="colour">if($component$="B", "#000000", $colour$)</eval>
      </change>
    </input>
    <input type="dropdown" token="severity" searchWhenChanged="true">
      <label>Severity</label>
      <choice value="Info">Info</choice>
      <choice value="Warning">Warning</choice>
    </input>
    <input id="colour_dropdown" type="dropdown" token="colour" searchWhenChanged="true">
      <label>Colour Dropdown</label>
      <choice value="#000000">Black</choice>
      <choice value="#ff0000">Red</choice>
      <choice value="#00ff00">Green</choice>
      <choice value="#0000ff">Blue</choice>
      <change>
        <set token="colour_name">$label$</set>
      </change>
    </input>
  </fieldset>
  <row depends="$AlwaysHideCSS$">
    <panel>
      <html>
        <style>
          #colour_dropdown {
            $display_colour$
          }
        </style>
      </html>
    </panel>
  </row>
  <row>
    <panel>
      <html>
        <h1 style="color:$colour$">Component $component$, Severity Level $severity$, Colour $colour_name$</h1>        
      </html>
    </panel>
  </row>
</form>

 

0 Karma

PickleRick
SplunkTrust
SplunkTrust

1. Please provide more meaningful subject than "ddl" for your post next time. It greatly improves readability of the whole forum and helps visibility of your issue.

2. As far as I remember there are no built-in mechanisms to control visibility of single input either in simplexml or in DS (btw, you didn't specify what type of dashboard you're building). With simplexml you can try to use custom JS to manipulate CSS to make components (in)visible.

0 Karma

moorte
Explorer

It sounds like the user should be making choices from the first two dropdowns and that supplies the fields that will be provided in the third dropdown.  

what you want to do this is to tokenize the first two dropdowns so that the answer from them is (use better token names)
$optionA$  for the first dropdown
$optionB$ for the second dropdown

Then in the third dropdown, fill the list from a query and use the tokens in the query so something like this

index=yourindex sourceytpe=yoursourcetype valuex=$optionA$ valuey=$optionB$

Or if it is a lookup file

| inputlookup yourlookupfile | search valuex=$optionA$ valuey=$optionB$

Hope that helps.  

LAME-Creations
SplunkTrust
SplunkTrust

Do this ^^^^^^^

0 Karma

tej57
Builder

Hello @Jasmine,

Is this resolved?

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...