Splunk Search

How to set one dropdown to default value (for ex: All) when i select values from the 2nd dropdown

rijinc
Explorer

there are two computed dropdown, just in case i select values from one dropdown the other dropdown should be reset to default(all) and vice versa.

I was entering something like this :

    <label>Deal Size</label>
    <default>*</default>
    <prefix>"</prefix>
    <suffix>"</suffix>
    <fieldForLabel>DealSize</fieldForLabel>
    <fieldForValue>DealSize</fieldForValue>
    <search>
      <query>| stats count by DealSize | dedup DealSize | fields DealSize</query>
    </search>
    <initialValue>*</initialValue>
    <choice value="*">All</choice>
     **<change>
     <set token="form.Fiscal_Year">*</set>
    </change>**
  </input>
  <input type="dropdown" token="Fiscal_Year" searchWhenChanged="true">
    <label>Fiscal Year</label>
    <default>All</default>
    <prefix>"</prefix>
    <suffix>"</suffix>
    <fieldForLabel>Fiscal_Year</fieldForLabel>
    <fieldForValue>Fiscal_Year</fieldForValue>
    <search>
      <query>| stats count by Fiscal_Year | dedup Fiscal_Year | fields Fiscal_Year</query>
    </search>
    <initialValue>*</initialValue>
    <choice value="*">All</choice>
     **<change>
<set token="form.DealSize">*</set>
    </change>**
  </input>

this is not getting set vice versa ...please let me know how this is possible ?

Tags (1)

niketn
Legend

Please add condition block to set the other dropdown as asterisk (*) only if the selected value in the current dropdown is not asterisk (*) i.e. <condition match="$value$!=&quot;*&quot;">

    <input type="dropdown" token="DealSize" searchWhenChanged="true">
     <label>Deal Size</label>
     <default>*</default>
     <prefix>"</prefix>
     <suffix>"</suffix>
     <fieldForLabel>DealSize</fieldForLabel>
     <fieldForValue>DealSize</fieldForValue>
     <search>
       <query>| stats count by DealSize | dedup DealSize | fields DealSize</query>
     </search>
     <initialValue>*</initialValue>
     <choice value="*">All</choice>
      <change>
        <condition match="$value$!=&quot;*&quot;">
          <set token="form.Fiscal_Year">*</set>
        </condition>
      </change>
    </input>
   <input type="dropdown" token="Fiscal_Year" searchWhenChanged="true">
     <label>Fiscal Year</label>
     <default>All</default>
     <prefix>"</prefix>
     <suffix>"</suffix>
     <fieldForLabel>Fiscal_Year</fieldForLabel>
     <fieldForValue>Fiscal_Year</fieldForValue>
     <search>
       <query>| stats count by Fiscal_Year | dedup Fiscal_Year | fields Fiscal_Year</query>
     </search>
     <initialValue>*</initialValue>
      <change>
        <condition match="$value$!=&quot;*&quot;">
          <set token="form.DealSize">*</set>
        </condition>
      </change>      
    </input>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...