<?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: How can i make a dropdown disappear based on a token value? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-i-make-a-dropdown-disappear-based-on-a-token-value/m-p/320309#M20638</link>
    <description>&lt;P&gt;Change your condition match to the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;condition match="'result.ter' &amp;gt; 1"&amp;gt;
    &amp;lt;set token="show_dropdown"&amp;gt;true&amp;lt;/set&amp;gt;
&amp;lt;/condition&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 05 Apr 2018 15:03:04 GMT</pubDate>
    <dc:creator>jconger</dc:creator>
    <dc:date>2018-04-05T15:03:04Z</dc:date>
    <item>
      <title>How can i make a dropdown disappear based on a token value?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-i-make-a-dropdown-disappear-based-on-a-token-value/m-p/320305#M20634</link>
      <description>&lt;P&gt;I need to have a dropdown appear and disappear in a dashboard, based on a value of a token which will get set using a search query. Is there a way to accomplish that in simple XML?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2018 22:55:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-i-make-a-dropdown-disappear-based-on-a-token-value/m-p/320305#M20634</guid>
      <dc:creator>singhbc</dc:creator>
      <dc:date>2018-04-04T22:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: How can i make a dropdown disappear based on a token value?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-i-make-a-dropdown-disappear-based-on-a-token-value/m-p/320306#M20635</link>
      <description>&lt;P&gt;Yes, check this out. &lt;A href="https://answers.splunk.com/answers/188709/how-to-display-dashboard-panels-dynamically.html"&gt;https://answers.splunk.com/answers/188709/how-to-display-dashboard-panels-dynamically.html&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2018 00:15:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-i-make-a-dropdown-disappear-based-on-a-token-value/m-p/320306#M20635</guid>
      <dc:creator>davpx</dc:creator>
      <dc:date>2018-04-05T00:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: How can i make a dropdown disappear based on a token value?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-i-make-a-dropdown-disappear-based-on-a-token-value/m-p/320307#M20636</link>
      <description>&lt;P&gt;Tokens work on field inputs too.  Here is an example I threw together.  If you set the the "Number of results to make" field to 1, the dropdown will disappear.  If you set the field to a number larger than 1, the dropdown will appear.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
    &amp;lt;label&amp;gt;Hide Dropdown&amp;lt;/label&amp;gt;
    &amp;lt;description&amp;gt;If more than result is shown, the "Magic dropdown" will disappear.&amp;lt;/description&amp;gt;
    &amp;lt;fieldset submitButton="true" autoRun="false"&amp;gt;
        &amp;lt;input type="text" token="result_count"&amp;gt;
            &amp;lt;label&amp;gt;Number of results to make:&amp;lt;/label&amp;gt;
            &amp;lt;default&amp;gt;1&amp;lt;/default&amp;gt;
        &amp;lt;/input&amp;gt;
        &amp;lt;input type="dropdown" token="field1" depends="$show_dropdown$"&amp;gt;
           &amp;lt;label&amp;gt;Magic dropdown:&amp;lt;/label&amp;gt;
           &amp;lt;choice value="1"&amp;gt;1&amp;lt;/choice&amp;gt;
           &amp;lt;choice value="2"&amp;gt;2&amp;lt;/choice&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&amp;gt;
           &amp;lt;query&amp;gt;| makeresults count=$result_count$&amp;lt;/query&amp;gt;
           &amp;lt;done&amp;gt;
             &amp;lt;condition match="$job.resultCount$ &amp;gt; 1"&amp;gt;
               &amp;lt;set token="show_dropdown"&amp;gt;true&amp;lt;/set&amp;gt;
             &amp;lt;/condition&amp;gt;
             &amp;lt;condition&amp;gt;
               &amp;lt;unset token="show_dropdown"&amp;gt;&amp;lt;/unset&amp;gt;
             &amp;lt;/condition&amp;gt;
           &amp;lt;/done&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>Thu, 05 Apr 2018 00:29:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-i-make-a-dropdown-disappear-based-on-a-token-value/m-p/320307#M20636</guid>
      <dc:creator>jconger</dc:creator>
      <dc:date>2018-04-05T00:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: How can i make a dropdown disappear based on a token value?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-i-make-a-dropdown-disappear-based-on-a-token-value/m-p/320308#M20637</link>
      <description>&lt;P&gt;why the following is not working? I made some changes. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
     &amp;lt;label&amp;gt;Hide Dropdown&amp;lt;/label&amp;gt;
     &amp;lt;description&amp;gt;If more than 1 result is shown, the "Magic dropdown" will disappear.&amp;lt;/description&amp;gt;
     &amp;lt;fieldset submitButton="false" autoRun="true"&amp;gt;

         &amp;lt;input type="dropdown" token="field1" depends="$show_dropdown$"&amp;gt;
            &amp;lt;label&amp;gt;Magic dropdown:&amp;lt;/label&amp;gt;
            &amp;lt;choice value="1"&amp;gt;1&amp;lt;/choice&amp;gt;
            &amp;lt;choice value="2"&amp;gt;2&amp;lt;/choice&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&amp;gt;
            &amp;lt;query&amp;gt;| rest /services/authentication/current-context splunk_server=local 
            |stats list(username) as username list(roles) as roles list(defaultApp) as defaultApp 
            | stats count by roles 
            | eval territory=substr(roles, 1, 2) 
            | head 1 
            | eval ter=case(territory="ad", 2)
            &amp;lt;/query&amp;gt;
            &amp;lt;done&amp;gt;
              &amp;lt;condition match="ter &amp;gt; 1"&amp;gt;
                &amp;lt;set token="show_dropdown"&amp;gt;true&amp;lt;/set&amp;gt;
              &amp;lt;/condition&amp;gt;
              &amp;lt;condition&amp;gt;
                &amp;lt;unset token="show_dropdown"&amp;gt;&amp;lt;/unset&amp;gt;
              &amp;lt;/condition&amp;gt;
            &amp;lt;/done&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>Thu, 05 Apr 2018 02:25:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-i-make-a-dropdown-disappear-based-on-a-token-value/m-p/320308#M20637</guid>
      <dc:creator>singhbc</dc:creator>
      <dc:date>2018-04-05T02:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: How can i make a dropdown disappear based on a token value?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-i-make-a-dropdown-disappear-based-on-a-token-value/m-p/320309#M20638</link>
      <description>&lt;P&gt;Change your condition match to the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;condition match="'result.ter' &amp;gt; 1"&amp;gt;
    &amp;lt;set token="show_dropdown"&amp;gt;true&amp;lt;/set&amp;gt;
&amp;lt;/condition&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Apr 2018 15:03:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-i-make-a-dropdown-disappear-based-on-a-token-value/m-p/320309#M20638</guid>
      <dc:creator>jconger</dc:creator>
      <dc:date>2018-04-05T15:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: How can i make a dropdown disappear based on a token value?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-i-make-a-dropdown-disappear-based-on-a-token-value/m-p/320310#M20639</link>
      <description>&lt;P&gt;Thanks! works like a charm!&lt;/P&gt;</description>
      <pubDate>Fri, 20 Apr 2018 19:02:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-i-make-a-dropdown-disappear-based-on-a-token-value/m-p/320310#M20639</guid>
      <dc:creator>singhbc</dc:creator>
      <dc:date>2018-04-20T19:02:38Z</dc:date>
    </item>
  </channel>
</rss>

