<?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 Can a token value from one dropdown input be used as part of the choice value statements in a second dropdown? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-a-token-value-from-one-dropdown-input-be-used-as-part-of-the/m-p/340420#M22124</link>
    <description>&lt;P&gt;I am creating a dashboard panel with multiple inputs.  I would like to be able to pass a token variable containing the selection from dropdown (1) for use as a value in dropdown (2).  The following are the 2 dropdown inputs that I am working on:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="dropdown" token="i_criteria"&amp;gt;
        &amp;lt;label&amp;gt;Search Criteria&amp;lt;/label&amp;gt;
        &amp;lt;choice value="spamscore"&amp;gt;Spam Score&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="malwarescore"&amp;gt;Malware Score&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="phishscore"&amp;gt;Phish Score&amp;lt;/choice&amp;gt;
      &amp;lt;/input&amp;gt;
      &amp;lt;input type="dropdown" token="i_score"&amp;gt;
        &amp;lt;label&amp;gt;Criteria Values&amp;lt;/label&amp;gt;
        &amp;lt;choice value="$i_criteria$=*"&amp;gt;all&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="$i_criteria$&amp;gt;0 $i_criteria$&amp;lt;50"&amp;gt;1-49&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="$i_criteria$&amp;gt;=50 $i_criteria$&amp;lt;100"&amp;gt;50-99&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="$i_criteria$=100"&amp;gt;100&amp;lt;/choice&amp;gt;
      &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;All of the &lt;CODE&gt;$i_criteria$&lt;/CODE&gt; values in the second input are being interpreted literally as opposed its actual value being replaced/inserted.&lt;/P&gt;

&lt;P&gt;Is there different way that this can be done?&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Thu, 08 Jun 2017 18:21:50 GMT</pubDate>
    <dc:creator>adamblock2</dc:creator>
    <dc:date>2017-06-08T18:21:50Z</dc:date>
    <item>
      <title>Can a token value from one dropdown input be used as part of the choice value statements in a second dropdown?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-a-token-value-from-one-dropdown-input-be-used-as-part-of-the/m-p/340420#M22124</link>
      <description>&lt;P&gt;I am creating a dashboard panel with multiple inputs.  I would like to be able to pass a token variable containing the selection from dropdown (1) for use as a value in dropdown (2).  The following are the 2 dropdown inputs that I am working on:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="dropdown" token="i_criteria"&amp;gt;
        &amp;lt;label&amp;gt;Search Criteria&amp;lt;/label&amp;gt;
        &amp;lt;choice value="spamscore"&amp;gt;Spam Score&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="malwarescore"&amp;gt;Malware Score&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="phishscore"&amp;gt;Phish Score&amp;lt;/choice&amp;gt;
      &amp;lt;/input&amp;gt;
      &amp;lt;input type="dropdown" token="i_score"&amp;gt;
        &amp;lt;label&amp;gt;Criteria Values&amp;lt;/label&amp;gt;
        &amp;lt;choice value="$i_criteria$=*"&amp;gt;all&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="$i_criteria$&amp;gt;0 $i_criteria$&amp;lt;50"&amp;gt;1-49&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="$i_criteria$&amp;gt;=50 $i_criteria$&amp;lt;100"&amp;gt;50-99&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="$i_criteria$=100"&amp;gt;100&amp;lt;/choice&amp;gt;
      &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;All of the &lt;CODE&gt;$i_criteria$&lt;/CODE&gt; values in the second input are being interpreted literally as opposed its actual value being replaced/inserted.&lt;/P&gt;

&lt;P&gt;Is there different way that this can be done?&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2017 18:21:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Can-a-token-value-from-one-dropdown-input-be-used-as-part-of-the/m-p/340420#M22124</guid>
      <dc:creator>adamblock2</dc:creator>
      <dc:date>2017-06-08T18:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: Can a token value from one dropdown input be used as part of the choice value statements in a second dropdown?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-a-token-value-from-one-dropdown-input-be-used-as-part-of-the/m-p/340421#M22125</link>
      <description>&lt;P&gt;@adamblock2, you can do this using the &lt;STRONG&gt;change&lt;/STRONG&gt; event of dropdown. Following is an example with condition and set/unset blocks and also $value$ which is one of the default tokens of dropdown.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="dropdown" token="i_criteria" searchWhenChanged="true"&amp;gt;
  &amp;lt;label&amp;gt;Search Criteria&amp;lt;/label&amp;gt;
  &amp;lt;choice value="spamscore"&amp;gt;Spam Score&amp;lt;/choice&amp;gt;
  &amp;lt;choice value="malwarescore"&amp;gt;Malware Score&amp;lt;/choice&amp;gt;
  &amp;lt;choice value="phishscore"&amp;gt;Phish Score&amp;lt;/choice&amp;gt;
  &amp;lt;change&amp;gt;
    &amp;lt;set token="i_score_string"&amp;gt;$value$=*&amp;lt;/set&amp;gt;
    &amp;lt;set token="i_score"&amp;gt;*&amp;lt;/set&amp;gt;
    &amp;lt;set token="form.i_score"&amp;gt;*&amp;lt;/set&amp;gt;
  &amp;lt;/change&amp;gt;
  &amp;lt;default&amp;gt;spamscore&amp;lt;/default&amp;gt;
&amp;lt;/input&amp;gt;
&amp;lt;input type="dropdown" token="i_score" searchWhenChanged="true"&amp;gt;
  &amp;lt;label&amp;gt;Criteria Values&amp;lt;/label&amp;gt;
  &amp;lt;choice value="*"&amp;gt;all&amp;lt;/choice&amp;gt;
  &amp;lt;choice value="49"&amp;gt;1-49&amp;lt;/choice&amp;gt;
  &amp;lt;choice value="99"&amp;gt;50-99&amp;lt;/choice&amp;gt;
  &amp;lt;choice value="100"&amp;gt;100&amp;lt;/choice&amp;gt;
  &amp;lt;change&amp;gt;
    &amp;lt;condition match="$value$==&amp;amp;quot;*&amp;amp;quot;"&amp;gt;
      &amp;lt;set token="i_score_string"&amp;gt;$i_criteria$=*&amp;lt;/set&amp;gt;
    &amp;lt;/condition&amp;gt;
    &amp;lt;condition match="$value$==&amp;amp;quot;49&amp;amp;quot;"&amp;gt;
      &amp;lt;set token="i_score_string"&amp;gt;$i_criteria$&amp;gt;0 $i_criteria$&amp;lt;50&amp;lt;/set&amp;gt;
    &amp;lt;/condition&amp;gt;
    &amp;lt;condition match="$value$==&amp;amp;quot;99&amp;amp;quot;"&amp;gt;
      &amp;lt;set token="i_score_string"&amp;gt;$i_criteria$&amp;gt;=50 $i_criteria$&amp;lt;99&amp;lt;/set&amp;gt;
    &amp;lt;/condition&amp;gt;
    &amp;lt;condition match="$value$==&amp;amp;quot;100&amp;amp;quot;"&amp;gt;
      &amp;lt;set token="i_score_string"&amp;gt;$i_criteria$=100&amp;lt;/set&amp;gt;
    &amp;lt;/condition&amp;gt;
  &amp;lt;/change&amp;gt;
  &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
&amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Refer to Splunk documentation on &lt;BR /&gt;
Event Handlers: &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Viz/EventHandlerReference"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Viz/EventHandlerReference&lt;/A&gt;&lt;BR /&gt;
and Token reference: &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Viz/TokenReference"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Viz/TokenReference&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2017 18:54:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Can-a-token-value-from-one-dropdown-input-be-used-as-part-of-the/m-p/340421#M22125</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-06-08T18:54:18Z</dc:date>
    </item>
  </channel>
</rss>

