<?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 database value in dropdown in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/database-value-in-dropdown/m-p/146161#M8908</link>
    <description>&lt;P&gt;Hi All,&lt;BR /&gt;
I am preparing a dashboard where in I want to place a dropdown and I want to pick the following query output in the dropdown &lt;BR /&gt;
"select book_type_code from  fa_deprn_periods where period_name='JAN-09'" .&lt;BR /&gt;
I have done the following and it is showing nothing in the dropbox.&lt;BR /&gt;
&lt;/P&gt;&lt;FORM&gt;&lt;BR /&gt;
    &lt;FIELDSET&gt;&lt;BR /&gt;
  &lt;INPUT type="dropdown" searchwhenchanged="true" token="drop" /&gt;&lt;BR /&gt;
&lt;POPULATINGSEARCH fieldforvalue="book_type_code" fieldforlabel="book_type_code"&gt;&lt;BR /&gt;
        &amp;lt;![CDATA[| dbquery "select book_type_code from  fa_deprn_periods where period_name='JAN-09'"]]&amp;gt;&lt;BR /&gt;
     &lt;/POPULATINGSEARCH&gt;&lt;BR /&gt;
     &lt;BR /&gt;
  &lt;/FIELDSET&gt;&lt;BR /&gt;
&lt;/FORM&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 15:51:50 GMT</pubDate>
    <dc:creator>vikas_gopal</dc:creator>
    <dc:date>2020-09-28T15:51:50Z</dc:date>
    <item>
      <title>database value in dropdown</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/database-value-in-dropdown/m-p/146161#M8908</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt;
I am preparing a dashboard where in I want to place a dropdown and I want to pick the following query output in the dropdown &lt;BR /&gt;
"select book_type_code from  fa_deprn_periods where period_name='JAN-09'" .&lt;BR /&gt;
I have done the following and it is showing nothing in the dropbox.&lt;BR /&gt;
&lt;/P&gt;&lt;FORM&gt;&lt;BR /&gt;
    &lt;FIELDSET&gt;&lt;BR /&gt;
  &lt;INPUT type="dropdown" searchwhenchanged="true" token="drop" /&gt;&lt;BR /&gt;
&lt;POPULATINGSEARCH fieldforvalue="book_type_code" fieldforlabel="book_type_code"&gt;&lt;BR /&gt;
        &amp;lt;![CDATA[| dbquery "select book_type_code from  fa_deprn_periods where period_name='JAN-09'"]]&amp;gt;&lt;BR /&gt;
     &lt;/POPULATINGSEARCH&gt;&lt;BR /&gt;
     &lt;BR /&gt;
  &lt;/FIELDSET&gt;&lt;BR /&gt;
&lt;/FORM&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:51:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/database-value-in-dropdown/m-p/146161#M8908</guid>
      <dc:creator>vikas_gopal</dc:creator>
      <dc:date>2020-09-28T15:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: database value in dropdown</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/database-value-in-dropdown/m-p/146162#M8909</link>
      <description>&lt;P&gt;You need to follow proper case when creating the view definition, Proper capitalization where ever needed. Have given the sample for you.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
&amp;lt;fieldset&amp;gt;
&amp;lt;input type="dropdown" searchWhenChanged="true" token="drop"&amp;gt;
&amp;lt;populatingSearch fieldForValue="book_type_code" fieldForLabel="book_type_code"&amp;gt;
 &amp;lt;![CDATA[| dbquery database_name "select book_type_code from fa_deprn_periods where period_name='JAN-09'"]]&amp;gt;
 &amp;lt;/populatingSearch&amp;gt;
 &amp;lt;/input&amp;gt;
 &amp;lt;/fieldset&amp;gt;
 &amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2014 18:34:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/database-value-in-dropdown/m-p/146162#M8909</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2014-02-11T18:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: database value in dropdown</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/database-value-in-dropdown/m-p/146163#M8910</link>
      <description>&lt;P&gt;Linu&lt;/P&gt;

&lt;P&gt;While pasting this code in the above section I manually delete the database name , but it is there in the actual code and sql query is returning results that I have checked .&lt;BR /&gt;
I do not have much idea about Cdata and I am not sure if I can use dbquery in CSDATA...Please suggest&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2014 18:41:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/database-value-in-dropdown/m-p/146163#M8910</guid>
      <dc:creator>vikas_gopal</dc:creator>
      <dc:date>2014-02-11T18:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: database value in dropdown</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/database-value-in-dropdown/m-p/146164#M8911</link>
      <description>&lt;P&gt;Just to be sure, check the field name returned by query when ran manually in search is matching fieldForValue and fieldForLabel values, including case&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2014 18:57:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/database-value-in-dropdown/m-p/146164#M8911</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-02-11T18:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: database value in dropdown</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/database-value-in-dropdown/m-p/146165#M8912</link>
      <description>&lt;P&gt;I found another solution for this . Using Lookup you can achieve the same.&lt;BR /&gt;
follow the following steps&lt;BR /&gt;
1) Create a csv file in the following location "Splunk homeetcappsdbxlookups lets say the file is "user.csv".Make sure u must have some data in the CSV file.Else if u chk my code I am creating a CSV from dbquery with the help of | outputlookup command.&lt;BR /&gt;
2) Create a new lookup from Settings---&amp;gt;Lookups--&amp;gt;Lookup table file  here select the same csv file which u have created u can choose the same file name in the destination lets say the name is "vikaslookup".&lt;BR /&gt;
3) Make sure u chkd the permissions it should be global.&lt;BR /&gt;
4) Now open splunk and type the following code and that is it.&lt;/P&gt;

&lt;P&gt;&lt;SEARCHTEMPLATE&gt;| dbquery "your database" "select abcdate as "Fromdate" from help"| outputlookup user.csv &lt;/SEARCHTEMPLATE&gt;&lt;BR /&gt;
&lt;FIELDSET&gt;&lt;BR /&gt;
    &lt;INPUT type="dropdown" token="FromDate" /&gt;&lt;BR /&gt;
      &lt;POPULATINGSEARCH fieldforvalue="FromDate" fieldforlabel="FromDate"&gt;&lt;BR /&gt;
        &amp;lt;![CDATA[ | inputlookup vikaslookup ]]&amp;gt;&lt;BR /&gt;
      &lt;/POPULATINGSEARCH&gt;&lt;BR /&gt;
      &lt;DEFAULT&gt;2013&lt;/DEFAULT&gt;&lt;BR /&gt;
 &lt;/FIELDSET&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2014 16:33:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/database-value-in-dropdown/m-p/146165#M8912</guid>
      <dc:creator>vikas_gopal</dc:creator>
      <dc:date>2014-02-18T16:33:47Z</dc:date>
    </item>
  </channel>
</rss>

