Getting Data In

how to get a dropdown filter value based on other value selected in other dropdown filter

dtccsundar
Path Finder

for example , i have country field drop down and city field dropdown like below ,

country City
IND Chennai
US New York
UK London

when i select IND from a drop down filter ,automaticllicay Chennai should be selected(displayed) in City dropdown filter .

Can anyone help me to do this .

0 Karma

vnravikumar
Champion

Hi

Try this, I used lookups

<form>
  <label>country_city</label>
  <fieldset submitButton="false">
    <input type="dropdown" token="country">
      <label>field1</label>
      <prefix>country="</prefix>
      <suffix>"</suffix>
      <fieldForLabel>country</fieldForLabel>
      <fieldForValue>country</fieldForValue>
      <search>
        <query>|inputlookup country.csv |table country</query>
        <earliest>-24h@h</earliest>
        <latest>now</latest>
      </search>
    </input>
    <input type="dropdown" token="city">
      <label>field2</label>
      <fieldForLabel>city</fieldForLabel>
      <fieldForValue>city</fieldForValue>
      <selectFirstChoice>true</selectFirstChoice>
      <search>
        <query>|inputlookup city.csv |search  $country$ | table city</query>
      </search>
    </input>
  </fieldset>
</form>

country.csv
country
IND
US
UK

city.csv
country,city
IND,Chennai
US,New York
UK,London

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...