<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Why doesn't the pulldown work the first time I select a value (with a trivial Example!)? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Why-doesn-t-the-pulldown-work-the-first-time-I-select-a-value/m-p/430600#M7713</link>
    <description>&lt;P&gt;Hi @ifeldshteyn &lt;/P&gt;

&lt;P&gt;I just tested this dashboard in my 7.1 Splunk instance and it works perfect - it always updates the raw results and the table.  However I do find it unusal that you are using a token to update the search of the input that sets the token.&lt;/P&gt;

&lt;P&gt;I made a few minor updates to your dashboard that you could try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
   &amp;lt;label&amp;gt;test&amp;lt;/label&amp;gt;
   &amp;lt;search id="base"&amp;gt;
     &amp;lt;!-- You should specify all fields that you plan to use later --&amp;gt;
     &amp;lt;query&amp;gt;index =_internal earliest=-1h| fields sourcetype _raw _time&amp;lt;/query&amp;gt;
   &amp;lt;/search&amp;gt;
   &amp;lt;fieldset submitButton="false"&amp;gt;
     &amp;lt;input type="dropdown" token="sourcetype"&amp;gt;
       &amp;lt;label&amp;gt;Sourcetypes&amp;lt;/label&amp;gt;
       &amp;lt;choice value="*"&amp;gt;All SourceTypes&amp;lt;/choice&amp;gt;
       &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
       &amp;lt;fieldForLabel&amp;gt;sourcetype&amp;lt;/fieldForLabel&amp;gt;
       &amp;lt;fieldForValue&amp;gt;sourcetype&amp;lt;/fieldForValue&amp;gt;
       &amp;lt;search base="base"&amp;gt;
         &amp;lt;!-- Remove filter on sourcetype --&amp;gt;
         &amp;lt;query&amp;gt;dedup sourcetype | sort sourcetype&amp;lt;/query&amp;gt;
       &amp;lt;/search&amp;gt;
     &amp;lt;/input&amp;gt;
   &amp;lt;/fieldset&amp;gt;
   &amp;lt;row&amp;gt;
     &amp;lt;panel&amp;gt;
       &amp;lt;table&amp;gt;
         &amp;lt;search base="base"&amp;gt;
           &amp;lt;!-- Use the $|s$ quoting when using tokens --&amp;gt;
           &amp;lt;query&amp;gt;search sourcetype=$sourcetype|s$ | head &amp;lt;/query&amp;gt;
         &amp;lt;/search&amp;gt;
       &amp;lt;/table&amp;gt;
     &amp;lt;/panel&amp;gt;
   &amp;lt;/row&amp;gt;
 &amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 29 Jan 2019 00:22:18 GMT</pubDate>
    <dc:creator>chrisyounger</dc:creator>
    <dc:date>2019-01-29T00:22:18Z</dc:date>
    <item>
      <title>Why doesn't the pulldown work the first time I select a value (with a trivial Example!)?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-doesn-t-the-pulldown-work-the-first-time-I-select-a-value/m-p/430599#M7712</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have a really simple dashboard with a single pulldown. I notice that it never seems to take effect the first time I select a value — only the second time.&lt;/P&gt;

&lt;P&gt;Here is the code with a base search and a simple table panel over the past hour. If I load this in Splunk (6.5.2) and run it, I will see the dropdown populated. If I choose one source type, it will immediately update the pulldown options but NOT update the table results. If I reset and chose another source type, it then takes effect. Hypothesis: this is because of a base search and filtering search for the dropdowns? I'd like for it to work the first time without requiring a Submit button. Note: I tried setting the option searchWhenChanged - but it didn't help. (searchWhenChanged="true")&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;test&amp;lt;/label&amp;gt;
  &amp;lt;search id="base"&amp;gt;
    &amp;lt;query&amp;gt;index =_internal earliest=-1h| fields sourcetype&amp;lt;/query&amp;gt;
  &amp;lt;/search&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="dropdown" token="sourcetype"&amp;gt;
      &amp;lt;label&amp;gt;Sourcetypes&amp;lt;/label&amp;gt;
      &amp;lt;choice value="*"&amp;gt;All SourceTypes&amp;lt;/choice&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;sourcetype&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;sourcetype&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search base="base"&amp;gt;
        &amp;lt;query&amp;gt;search sourcetype="*$sourcetype$*" | dedup sourcetype | sort sourcetype&amp;lt;/query&amp;gt;
      &amp;lt;/search&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search base="base"&amp;gt;
          &amp;lt;query&amp;gt;search sourcetype="*$sourcetype$*" | head &amp;lt;/query&amp;gt;
        &amp;lt;/search&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Jan 2019 00:10:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-doesn-t-the-pulldown-work-the-first-time-I-select-a-value/m-p/430599#M7712</guid>
      <dc:creator>ifeldshteyn</dc:creator>
      <dc:date>2019-01-29T00:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't the pulldown work the first time I select a value (with a trivial Example!)?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-doesn-t-the-pulldown-work-the-first-time-I-select-a-value/m-p/430600#M7713</link>
      <description>&lt;P&gt;Hi @ifeldshteyn &lt;/P&gt;

&lt;P&gt;I just tested this dashboard in my 7.1 Splunk instance and it works perfect - it always updates the raw results and the table.  However I do find it unusal that you are using a token to update the search of the input that sets the token.&lt;/P&gt;

&lt;P&gt;I made a few minor updates to your dashboard that you could try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
   &amp;lt;label&amp;gt;test&amp;lt;/label&amp;gt;
   &amp;lt;search id="base"&amp;gt;
     &amp;lt;!-- You should specify all fields that you plan to use later --&amp;gt;
     &amp;lt;query&amp;gt;index =_internal earliest=-1h| fields sourcetype _raw _time&amp;lt;/query&amp;gt;
   &amp;lt;/search&amp;gt;
   &amp;lt;fieldset submitButton="false"&amp;gt;
     &amp;lt;input type="dropdown" token="sourcetype"&amp;gt;
       &amp;lt;label&amp;gt;Sourcetypes&amp;lt;/label&amp;gt;
       &amp;lt;choice value="*"&amp;gt;All SourceTypes&amp;lt;/choice&amp;gt;
       &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
       &amp;lt;fieldForLabel&amp;gt;sourcetype&amp;lt;/fieldForLabel&amp;gt;
       &amp;lt;fieldForValue&amp;gt;sourcetype&amp;lt;/fieldForValue&amp;gt;
       &amp;lt;search base="base"&amp;gt;
         &amp;lt;!-- Remove filter on sourcetype --&amp;gt;
         &amp;lt;query&amp;gt;dedup sourcetype | sort sourcetype&amp;lt;/query&amp;gt;
       &amp;lt;/search&amp;gt;
     &amp;lt;/input&amp;gt;
   &amp;lt;/fieldset&amp;gt;
   &amp;lt;row&amp;gt;
     &amp;lt;panel&amp;gt;
       &amp;lt;table&amp;gt;
         &amp;lt;search base="base"&amp;gt;
           &amp;lt;!-- Use the $|s$ quoting when using tokens --&amp;gt;
           &amp;lt;query&amp;gt;search sourcetype=$sourcetype|s$ | head &amp;lt;/query&amp;gt;
         &amp;lt;/search&amp;gt;
       &amp;lt;/table&amp;gt;
     &amp;lt;/panel&amp;gt;
   &amp;lt;/row&amp;gt;
 &amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Jan 2019 00:22:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-doesn-t-the-pulldown-work-the-first-time-I-select-a-value/m-p/430600#M7713</guid>
      <dc:creator>chrisyounger</dc:creator>
      <dc:date>2019-01-29T00:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't the pulldown work the first time I select a value (with a trivial Example!)?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-doesn-t-the-pulldown-work-the-first-time-I-select-a-value/m-p/430601#M7714</link>
      <description>&lt;P&gt;Hi, I know I can get this to work, but then, if I add additional pulldowns, they are not filtered. Here is an example with additional pulldown of Source. If I filter a sourcetype, the source pulldown is not filtered and vice versa. In effect, I want, upon a pulldown selection to fillter the options in other pulldowns AND the downstream data. And I can get it to work only if I select something twice, or use a submit button which I was hoping to avoid. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="dropdown" token="sourcetype" searchWhenChanged="true"&amp;gt;
  &amp;lt;label&amp;gt;Sourcetypes&amp;lt;/label&amp;gt;
  &amp;lt;choice value="*"&amp;gt;All SourceTypes&amp;lt;/choice&amp;gt;
  &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
  &amp;lt;fieldForLabel&amp;gt;sourcetype&amp;lt;/fieldForLabel&amp;gt;
  &amp;lt;fieldForValue&amp;gt;sourcetype&amp;lt;/fieldForValue&amp;gt;
  &amp;lt;search base="base"&amp;gt;
    &amp;lt;query&amp;gt;dedup sourcetype | sort sourcetype&amp;lt;/query&amp;gt;
  &amp;lt;/search&amp;gt;
&amp;lt;/input&amp;gt;
    &amp;lt;input type="dropdown" token="source" searchWhenChanged="true"&amp;gt;
  &amp;lt;label&amp;gt;Sourcetypes&amp;lt;/label&amp;gt;
  &amp;lt;choice value="*"&amp;gt;All Source&amp;lt;/choice&amp;gt;
  &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
  &amp;lt;fieldForLabel&amp;gt;source&amp;lt;/fieldForLabel&amp;gt;
  &amp;lt;fieldForValue&amp;gt;source&amp;lt;/fieldForValue&amp;gt;
  &amp;lt;search base="base"&amp;gt;
    &amp;lt;query&amp;gt;dedup source | sort source&amp;lt;/query&amp;gt;
  &amp;lt;/search&amp;gt;
&amp;lt;/input&amp;gt;


&amp;lt;panel&amp;gt;
  &amp;lt;table&amp;gt;
    &amp;lt;search base="base"&amp;gt;
      &amp;lt;query&amp;gt;search sourcetype="*$sourcetype$*" source = "*$source$*"| head&amp;lt;/query&amp;gt;
    &amp;lt;/search&amp;gt;
  &amp;lt;/table&amp;gt;
&amp;lt;/panel&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Jan 2019 17:36:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-doesn-t-the-pulldown-work-the-first-time-I-select-a-value/m-p/430601#M7714</guid>
      <dc:creator>ifeldshteyn</dc:creator>
      <dc:date>2019-01-29T17:36:30Z</dc:date>
    </item>
  </channel>
</rss>

