Getting Data In

How to make input dependent on other inputs in a form?

oriches
Explorer

How can I make a combo box dependent on another combo box in a form?

The contents of the second combo box is dependent on the selection in the first.

Tags (3)
0 Karma
1 Solution

Damien_Dallimor
Ultra Champion

You'll have to use Advanced XML.

Lots of info in answers already such as this thread.

View solution in original post

0 Karma

iKate
Builder

You do not necessarily have to use Advanced XML for this at least in Splunk v6.0. Here's my example of how device_type selected with radio button is passed to the search populating dropdown. In two words: just add in the beginning of populating search your previous value like device_type=$device_type$

<fieldset autoRun="true" submitButton="false">
<input type="time" searchWhenChanged="true" token="cohort"> <default>Last 30 days</default> </input>
<input type="time" searchWhenChanged="true" token="search"> <default>Last 30 days</default> </input>
<!-- Specify search when changed for the inputs -->
<input type="radio" token="device_type" searchWhenChanged="true">
  <label>Select a device type:</label>
  <default>All</default>

  <!-- Define the choices in code -->
  <choice value="*">All</choice>
  <choice value="TV">TV</choice>
  <choice value="BDP">BDP</choice>
  <choice value="WEB">WEB</choice>
  <choice value="TBL">TBL</choice>
  <choice value="MOB">MOB</choice>
</input>

<input type="dropdown" token="device_manufacturer" searchWhenChanged="true">
  <label>Select a device manfacturer:</label>
  <prefix>device_manufacturer="</prefix>
  <suffix>"</suffix>
  <default>*</default>

  <!-- Define the default value -->      
  <choice value="*">All</choice>

  <!-- Define the choices with a populating search -->
  <populatingSearch fieldForValue="device_manufacturer" fieldForLabel="device_manufacturer" earliest="-48h" latest="now">
    <![CDATA[source=sc_context_creation device_type="$device_type$" | eval device_manufacturer=lower(device_manufacturer) 
    | stats count by device_manufacturer | sort 0 - count]]>
  </populatingSearch>
</input>

Damien_Dallimor
Ultra Champion

You'll have to use Advanced XML.

Lots of info in answers already such as this thread.

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 ...