<?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: Add to a dynamic dropdown in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Add-to-a-dynamic-dropdown/m-p/326468#M21104</link>
    <description>&lt;P&gt;Hi!&lt;/P&gt;

&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;input type="dropdown" token="Product_token" searchWhenChanged="true"&amp;gt;
       &amp;lt;label&amp;gt;Select a Product&amp;lt;/label&amp;gt;
       &amp;lt;search&amp;gt;
       &amp;lt;query&amp;gt;index=wholesale_app  product|dedup product&amp;lt;/query&amp;gt;
       &amp;lt;earliest&amp;gt;-1d&amp;lt;/earliest&amp;gt;
         &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
       &amp;lt;/search&amp;gt;
       &amp;lt;fieldForLabel&amp;gt;product&amp;lt;/fieldForLabel&amp;gt;
       &amp;lt;fieldForValue&amp;gt;product&amp;lt;/fieldForValue&amp;gt;

       &amp;lt;choice value="*"&amp;gt;- All -&amp;lt;/choice&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
      &amp;lt;initialValue&amp;gt;*&amp;lt;/initialValue&amp;gt;
     &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Tell me if it's ok for you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
Regards!&lt;/P&gt;</description>
    <pubDate>Mon, 04 Dec 2017 16:32:06 GMT</pubDate>
    <dc:creator>Javip</dc:creator>
    <dc:date>2017-12-04T16:32:06Z</dc:date>
    <item>
      <title>Add to a dynamic dropdown</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Add-to-a-dynamic-dropdown/m-p/326467#M21103</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have this XML code&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;input type="dropdown" token="Product_token" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Select a Product&amp;lt;/label&amp;gt;
      &amp;lt;search&amp;gt;
      &amp;lt;query&amp;gt;index=wholesale_app  product|dedup product&amp;lt;/query&amp;gt;
      &amp;lt;earliest&amp;gt;-1d&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/search&amp;gt;

      &amp;lt;fieldForLabel&amp;gt;product&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;product&amp;lt;/fieldForValue&amp;gt;


    &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And it works just fine.  I populates a dropdown with 2 values (lets call them Product 1 and Product 2) and I have working queries that adjust when the user selects one of the two products.  So far so good.  Now what I'd like to do is manually insert a "all" product so the users can select it and will see all the values regardless of product.  Is there a way to manually insert a value to a dynamic dropdown?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2017 16:22:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Add-to-a-dynamic-dropdown/m-p/326467#M21103</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2017-12-04T16:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Add to a dynamic dropdown</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Add-to-a-dynamic-dropdown/m-p/326468#M21104</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;

&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;input type="dropdown" token="Product_token" searchWhenChanged="true"&amp;gt;
       &amp;lt;label&amp;gt;Select a Product&amp;lt;/label&amp;gt;
       &amp;lt;search&amp;gt;
       &amp;lt;query&amp;gt;index=wholesale_app  product|dedup product&amp;lt;/query&amp;gt;
       &amp;lt;earliest&amp;gt;-1d&amp;lt;/earliest&amp;gt;
         &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
       &amp;lt;/search&amp;gt;
       &amp;lt;fieldForLabel&amp;gt;product&amp;lt;/fieldForLabel&amp;gt;
       &amp;lt;fieldForValue&amp;gt;product&amp;lt;/fieldForValue&amp;gt;

       &amp;lt;choice value="*"&amp;gt;- All -&amp;lt;/choice&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
      &amp;lt;initialValue&amp;gt;*&amp;lt;/initialValue&amp;gt;
     &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Tell me if it's ok for you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
Regards!&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2017 16:32:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Add-to-a-dynamic-dropdown/m-p/326468#M21104</guid>
      <dc:creator>Javip</dc:creator>
      <dc:date>2017-12-04T16:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: Add to a dynamic dropdown</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Add-to-a-dynamic-dropdown/m-p/326469#M21105</link>
      <description>&lt;P&gt;There's probably a good way to do this with token manipulation, too, but I have an idea for how to append a small bit of SPL to the end of your query and slightly change the XML to reach your goal. If you add a field called "product_name" to each event and fill it with the current value of "product" and then append a dummy event with product_name="All" and product="*", and then modify your XML slightly to use the fieldForLabel of product_name, then you should be set. So all together, it looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;input type="dropdown" token="Product_token" searchWhenChanged="true"&amp;gt;
       &amp;lt;label&amp;gt;Select a Product&amp;lt;/label&amp;gt;
       &amp;lt;search&amp;gt;
       &amp;lt;query&amp;gt;index=wholesale_app  product|dedup product | eval product_name=product | append [| stats count | eval product="*", product_name="All" | fields - count]&amp;lt;/query&amp;gt;
       &amp;lt;earliest&amp;gt;-1d&amp;lt;/earliest&amp;gt;
         &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
       &amp;lt;/search&amp;gt;
       &amp;lt;fieldForLabel&amp;gt;product_name&amp;lt;/fieldForLabel&amp;gt;
       &amp;lt;fieldForValue&amp;gt;product&amp;lt;/fieldForValue&amp;gt;
&amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:03:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Add-to-a-dynamic-dropdown/m-p/326469#M21105</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2020-09-29T17:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: Add to a dynamic dropdown</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Add-to-a-dynamic-dropdown/m-p/326470#M21106</link>
      <description>&lt;P&gt;Hi Javip,&lt;/P&gt;

&lt;P&gt;Wow, that was simple!  Many many thanks!!!!  &lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2017 16:37:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Add-to-a-dynamic-dropdown/m-p/326470#M21106</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2017-12-04T16:37:38Z</dc:date>
    </item>
  </channel>
</rss>

