<?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 How to control the default in a dropdown menu in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-control-the-default-in-a-dropdown-menu/m-p/427802#M74947</link>
    <description>&lt;P&gt;I have the following dropdown menu:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;fieldset autoRun="true" submitButton="false"&amp;gt;
    &amp;lt;input type="dropdown" token="select_wday"&amp;gt;
      &amp;lt;label&amp;gt;Select Day:&amp;lt;/label&amp;gt;
      &amp;lt;choice value="Mon"&amp;gt;Mon&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="Tue"&amp;gt;Tue&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="Wed"&amp;gt;Wed&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="Thu"&amp;gt;Thu&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="Fri"&amp;gt;Fri&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="Sat"&amp;gt;Sat&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="Sun"&amp;gt;Sun&amp;lt;/choice&amp;gt;
      &amp;lt;default&amp;gt;Fri&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The default in the drop-down above would be Friday. Is there a way I could control it that if the user visited the dashboard on a Wednesday the would Wednesday as the value in the drop-down menu? &lt;/P&gt;

&lt;P&gt;I am thinking something liket the below which I have used to populate a checkbox, but I have not used it to set the default.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;           &amp;lt;populatingSearch fieldForValue="userLabel" fieldForLabel="userLabel" earliest="-24h" latest="now"&amp;gt;
        &amp;lt;![CDATA[
&amp;lt;search goes here that would give the current day of the week&amp;gt;
        ]]&amp;gt;
      &amp;lt;/populatingSearch&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 06 Jul 2018 00:16:01 GMT</pubDate>
    <dc:creator>HattrickNZ</dc:creator>
    <dc:date>2018-07-06T00:16:01Z</dc:date>
    <item>
      <title>How to control the default in a dropdown menu</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-control-the-default-in-a-dropdown-menu/m-p/427802#M74947</link>
      <description>&lt;P&gt;I have the following dropdown menu:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;fieldset autoRun="true" submitButton="false"&amp;gt;
    &amp;lt;input type="dropdown" token="select_wday"&amp;gt;
      &amp;lt;label&amp;gt;Select Day:&amp;lt;/label&amp;gt;
      &amp;lt;choice value="Mon"&amp;gt;Mon&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="Tue"&amp;gt;Tue&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="Wed"&amp;gt;Wed&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="Thu"&amp;gt;Thu&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="Fri"&amp;gt;Fri&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="Sat"&amp;gt;Sat&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="Sun"&amp;gt;Sun&amp;lt;/choice&amp;gt;
      &amp;lt;default&amp;gt;Fri&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The default in the drop-down above would be Friday. Is there a way I could control it that if the user visited the dashboard on a Wednesday the would Wednesday as the value in the drop-down menu? &lt;/P&gt;

&lt;P&gt;I am thinking something liket the below which I have used to populate a checkbox, but I have not used it to set the default.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;           &amp;lt;populatingSearch fieldForValue="userLabel" fieldForLabel="userLabel" earliest="-24h" latest="now"&amp;gt;
        &amp;lt;![CDATA[
&amp;lt;search goes here that would give the current day of the week&amp;gt;
        ]]&amp;gt;
      &amp;lt;/populatingSearch&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Jul 2018 00:16:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-control-the-default-in-a-dropdown-menu/m-p/427802#M74947</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2018-07-06T00:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to control the default in a dropdown menu</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-control-the-default-in-a-dropdown-menu/m-p/427803#M74948</link>
      <description>&lt;PRE&gt;|makeresults  | eval Date=strftime(_time," %a") | table Date&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Jul 2018 00:26:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-control-the-default-in-a-dropdown-menu/m-p/427803#M74948</guid>
      <dc:creator>pradeepkumarg</dc:creator>
      <dc:date>2018-07-06T00:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to control the default in a dropdown menu</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-control-the-default-in-a-dropdown-menu/m-p/427804#M74949</link>
      <description>&lt;P&gt;This will give you the complete list with first option as Today's&lt;/P&gt;

&lt;PRE&gt;
|makeresults  | eval Date=strftime(_time," %a") | table Date
| append [|gentimes start=10/28/07 | head 7 | eval Date=strftime(endtime," %a") | table Date] | dedup Date
&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Jul 2018 00:33:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-control-the-default-in-a-dropdown-menu/m-p/427804#M74949</guid>
      <dc:creator>pradeepkumarg</dc:creator>
      <dc:date>2018-07-06T00:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to control the default in a dropdown menu</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-control-the-default-in-a-dropdown-menu/m-p/427805#M74950</link>
      <description>&lt;P&gt;tks, my question was more around the xml part. how should the xml code look?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2018 02:11:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-control-the-default-in-a-dropdown-menu/m-p/427805#M74950</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2018-07-06T02:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to control the default in a dropdown menu</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-control-the-default-in-a-dropdown-menu/m-p/427806#M74951</link>
      <description>&lt;P&gt;Hi @HattrickNZ&lt;/P&gt;

&lt;P&gt;give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;check123&amp;lt;/label&amp;gt;
      &amp;lt;search&amp;gt;
      &amp;lt;query&amp;gt;|makeresults  | eval Date=strftime(_time," %a") | table Date&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-15m&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
          &amp;lt;finalized &amp;gt;
                     &amp;lt;condition match=" 'job.resultCount' != 0"&amp;gt;
                             &amp;lt;set token="Date"&amp;gt;$result.Date$&amp;lt;/set&amp;gt;
                      &amp;lt;/condition&amp;gt;
           &amp;lt;/finalized &amp;gt;           
    &amp;lt;/search&amp;gt;
     &amp;lt;fieldset autoRun="true" submitButton="false"&amp;gt;
     &amp;lt;input type="dropdown" token="select_wday"&amp;gt;
       &amp;lt;label&amp;gt;Select Day:&amp;lt;/label&amp;gt;
       &amp;lt;choice value="Mon"&amp;gt;Mon&amp;lt;/choice&amp;gt;
       &amp;lt;choice value="Tue"&amp;gt;Tue&amp;lt;/choice&amp;gt;
       &amp;lt;choice value="Wed"&amp;gt;Wed&amp;lt;/choice&amp;gt;
       &amp;lt;choice value="Thu"&amp;gt;Thu&amp;lt;/choice&amp;gt;
       &amp;lt;choice value="Fri"&amp;gt;Fri&amp;lt;/choice&amp;gt;
       &amp;lt;choice value="Sat"&amp;gt;Sat&amp;lt;/choice&amp;gt;
       &amp;lt;choice value="Sun"&amp;gt;Sun&amp;lt;/choice&amp;gt;
       &amp;lt;default&amp;gt;$Date$&amp;lt;/default&amp;gt;
     &amp;lt;/input&amp;gt;
   &amp;lt;/fieldset&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2018 02:30:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-control-the-default-in-a-dropdown-menu/m-p/427806#M74951</guid>
      <dc:creator>PowerPacked</dc:creator>
      <dc:date>2018-07-06T02:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to control the default in a dropdown menu</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-control-the-default-in-a-dropdown-menu/m-p/427807#M74952</link>
      <description>&lt;P&gt;that's kind of it.&lt;/P&gt;

&lt;P&gt;but it is putting a &lt;CODE&gt;space&lt;/CODE&gt;(%20) before the &lt;CODE&gt;Fri&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;for example the url goes to this&lt;BR /&gt;
&lt;CODE&gt;/check123?form.select_wday=%20Fri&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;and if I wanna pass the &lt;CODE&gt;select_wday&lt;/CODE&gt; to other panels further down it puts the space in front of Fri.&lt;BR /&gt;
Any way to not add the space?&lt;BR /&gt;
tks&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2018 03:04:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-control-the-default-in-a-dropdown-menu/m-p/427807#M74952</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2018-07-06T03:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to control the default in a dropdown menu</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-control-the-default-in-a-dropdown-menu/m-p/427808#M74953</link>
      <description>&lt;P&gt;extra space was added in | eval Date=strftime(_time," %a")&lt;/P&gt;

&lt;P&gt;try taking out the space as this ---- | eval Date=strftime(_time,"%a")&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2018 03:21:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-control-the-default-in-a-dropdown-menu/m-p/427808#M74953</guid>
      <dc:creator>PowerPacked</dc:creator>
      <dc:date>2018-07-06T03:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to control the default in a dropdown menu</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-control-the-default-in-a-dropdown-menu/m-p/427809#M74954</link>
      <description>&lt;P&gt;tks missed that!&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2018 03:28:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-control-the-default-in-a-dropdown-menu/m-p/427809#M74954</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2018-07-06T03:28:24Z</dc:date>
    </item>
  </channel>
</rss>

