<?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 Populate dropdown based on initialized token in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Populate-dropdown-based-on-initialized-token/m-p/441839#M29110</link>
    <description>&lt;P&gt;I have a dashboard with a dropdown that contains a list of values.  The value of the choices must change based on what is chosen from another dropdown, but the label needs to stay the same.&lt;/P&gt;

&lt;P&gt;First, I tried just putting the token name in the value of the static dropdowns, but when I tried that, the dropdown defaulted to the value, instead of its label, which I think it does if no value matches what it has.  In other words, Splunk is not parsing the value of the token in the static values.  I can't have the value showing up in the label of the dropdown.  This is unnacceptable for my use case.&lt;/P&gt;

&lt;P&gt;Secondly, I removed all static choices and am using a dynamic query, but the query does not recognize the token either.  I am using tokens in all of my other dynamic dropdowns just fine and i'm only having trouble with this one.  It is the only one using a token initilized on page load.  I verified the token is set on page load already by extracting its value elsewhere.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt; form&amp;gt;
  &amp;lt;label&amp;gt;Title&amp;lt;/label&amp;gt;
  &amp;lt;init&amp;gt;
    &amp;lt;set token="env_prod_tag"&amp;gt;ProdIndexED&amp;lt;/set&amp;gt;
    &amp;lt;set token="env_nonprod_tag"&amp;gt;NonProdIndexED&amp;lt;/set&amp;gt;
  &amp;lt;/init&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The dropdown is this.  It's basically 4 rows, or 4 makeresults appended together.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;input type="dropdown" token="EnvironmentType" searchWhenChanged="false"&amp;gt;
      &amp;lt;label&amp;gt;Environment Type&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;&amp;lt;/default&amp;gt;
      &amp;lt;initialValue&amp;gt;&amp;lt;/initialValue&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;label&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;value&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;| makeresults 1 
| eval label="ED Production" 
| eval value=$env_prod_tag$
| append 
    [| makeresults 1 
    | eval label="All Production" 
    | eval value="ProdIndex"] 
| append 
    [| makeresults 1 
    | eval label="ED Non-Production" 
    | eval value=$env_nonprod_tag$] 
| append 
    [| makeresults 1 
    | eval label="All Non-Production" 
    | eval value="NonProdIndex"] 
| table label, value&amp;lt;/query&amp;gt;
      &amp;lt;/search&amp;gt;
    &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;On the dashboard, both tags are confirmed set.&lt;/P&gt;

&lt;P&gt;There is no error in the dropdown.  I have a search panel with the same query as the dropdown so I can debug it.  The error in the search panel is "Search is waiting for input...", indicating the token is not set.&lt;/P&gt;

&lt;P&gt;The token is set.&lt;/P&gt;

&lt;P&gt;Please let me know what I may be missing.  thanks,&lt;BR /&gt;
-Chris&lt;/P&gt;</description>
    <pubDate>Fri, 15 Mar 2019 16:05:56 GMT</pubDate>
    <dc:creator>weidertc</dc:creator>
    <dc:date>2019-03-15T16:05:56Z</dc:date>
    <item>
      <title>Populate dropdown based on initialized token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Populate-dropdown-based-on-initialized-token/m-p/441839#M29110</link>
      <description>&lt;P&gt;I have a dashboard with a dropdown that contains a list of values.  The value of the choices must change based on what is chosen from another dropdown, but the label needs to stay the same.&lt;/P&gt;

&lt;P&gt;First, I tried just putting the token name in the value of the static dropdowns, but when I tried that, the dropdown defaulted to the value, instead of its label, which I think it does if no value matches what it has.  In other words, Splunk is not parsing the value of the token in the static values.  I can't have the value showing up in the label of the dropdown.  This is unnacceptable for my use case.&lt;/P&gt;

&lt;P&gt;Secondly, I removed all static choices and am using a dynamic query, but the query does not recognize the token either.  I am using tokens in all of my other dynamic dropdowns just fine and i'm only having trouble with this one.  It is the only one using a token initilized on page load.  I verified the token is set on page load already by extracting its value elsewhere.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt; form&amp;gt;
  &amp;lt;label&amp;gt;Title&amp;lt;/label&amp;gt;
  &amp;lt;init&amp;gt;
    &amp;lt;set token="env_prod_tag"&amp;gt;ProdIndexED&amp;lt;/set&amp;gt;
    &amp;lt;set token="env_nonprod_tag"&amp;gt;NonProdIndexED&amp;lt;/set&amp;gt;
  &amp;lt;/init&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The dropdown is this.  It's basically 4 rows, or 4 makeresults appended together.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;input type="dropdown" token="EnvironmentType" searchWhenChanged="false"&amp;gt;
      &amp;lt;label&amp;gt;Environment Type&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;&amp;lt;/default&amp;gt;
      &amp;lt;initialValue&amp;gt;&amp;lt;/initialValue&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;label&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;value&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;| makeresults 1 
| eval label="ED Production" 
| eval value=$env_prod_tag$
| append 
    [| makeresults 1 
    | eval label="All Production" 
    | eval value="ProdIndex"] 
| append 
    [| makeresults 1 
    | eval label="ED Non-Production" 
    | eval value=$env_nonprod_tag$] 
| append 
    [| makeresults 1 
    | eval label="All Non-Production" 
    | eval value="NonProdIndex"] 
| table label, value&amp;lt;/query&amp;gt;
      &amp;lt;/search&amp;gt;
    &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;On the dashboard, both tags are confirmed set.&lt;/P&gt;

&lt;P&gt;There is no error in the dropdown.  I have a search panel with the same query as the dropdown so I can debug it.  The error in the search panel is "Search is waiting for input...", indicating the token is not set.&lt;/P&gt;

&lt;P&gt;The token is set.&lt;/P&gt;

&lt;P&gt;Please let me know what I may be missing.  thanks,&lt;BR /&gt;
-Chris&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2019 16:05:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Populate-dropdown-based-on-initialized-token/m-p/441839#M29110</guid>
      <dc:creator>weidertc</dc:creator>
      <dc:date>2019-03-15T16:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: Populate dropdown based on initialized token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Populate-dropdown-based-on-initialized-token/m-p/441840#M29111</link>
      <description>&lt;P&gt;@weidertc  I think you are missing double quotes for tokens. Like &lt;CODE&gt;| eval value="$env_prod_tag$"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Please try the following and confirm:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Dropdown&amp;lt;/label&amp;gt;
   &amp;lt;init&amp;gt;
     &amp;lt;set token="env_prod_tag"&amp;gt;ProdIndexED&amp;lt;/set&amp;gt;
     &amp;lt;set token="env_nonprod_tag"&amp;gt;NonProdIndexED&amp;lt;/set&amp;gt;
   &amp;lt;/init&amp;gt;
   &amp;lt;fieldset submitButton="false"&amp;gt;&amp;lt;/fieldset&amp;gt;
   &amp;lt;row&amp;gt;
     &amp;lt;panel&amp;gt;
       &amp;lt;input type="dropdown" token="EnvironmentType" searchWhenChanged="false"&amp;gt;
         &amp;lt;label&amp;gt;Environment Type&amp;lt;/label&amp;gt;
         &amp;lt;default&amp;gt;&amp;lt;/default&amp;gt;
         &amp;lt;initialValue&amp;gt;&amp;lt;/initialValue&amp;gt;
         &amp;lt;fieldForLabel&amp;gt;label&amp;lt;/fieldForLabel&amp;gt;
         &amp;lt;fieldForValue&amp;gt;value&amp;lt;/fieldForValue&amp;gt;
         &amp;lt;search&amp;gt;
           &amp;lt;query&amp;gt;| makeresults 1 
   | eval label="ED Production" 
   | eval value="$env_prod_tag$"
   | append 
       [| makeresults 1 
       | eval label="All Production" 
       | eval value="ProdIndex"] 
   | append 
       [| makeresults 1 
       | eval label="ED Non-Production" 
       | eval value="$env_nonprod_tag$"] 
   | append 
       [| makeresults 1 
       | eval label="All Non-Production" 
       | eval value="NonProdIndex"] 
   | table label, value&amp;lt;/query&amp;gt;
         &amp;lt;/search&amp;gt;
         &amp;lt;change&amp;gt;
           &amp;lt;set token="selectedLabel"&amp;gt;$label$&amp;lt;/set&amp;gt;
         &amp;lt;/change&amp;gt;
       &amp;lt;/input&amp;gt;
       &amp;lt;html&amp;gt;
         &amp;lt;div&amp;gt;
           Selected Label: $selectedLabel$ | Selected Value: $EnvironmentType$
         &amp;lt;/div&amp;gt;
       &amp;lt;/html&amp;gt;
     &amp;lt;/panel&amp;gt;
   &amp;lt;/row&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 1 
           | eval label="ED Production" 
           | eval value="$env_prod_tag$"
           | append 
               [| makeresults 1 
               | eval label="All Production" 
               | eval value="ProdIndex"] 
           | append 
               [| makeresults 1 
               | eval label="ED Non-Production" 
               | eval value="$env_nonprod_tag$"] 
           | append 
               [| makeresults 1 
               | eval label="All Non-Production" 
               | eval value="NonProdIndex"] 
           | table label, value
           &amp;lt;/query&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>Sun, 17 Mar 2019 03:39:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Populate-dropdown-based-on-initialized-token/m-p/441840#M29111</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2019-03-17T03:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: Populate dropdown based on initialized token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Populate-dropdown-based-on-initialized-token/m-p/441841#M29112</link>
      <description>&lt;P&gt;Good catch.  I have just tried this, but it made no difference.  I am still getting the value instead of the label.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2019 21:07:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Populate-dropdown-based-on-initialized-token/m-p/441841#M29112</guid>
      <dc:creator>weidertc</dc:creator>
      <dc:date>2019-03-18T21:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: Populate dropdown based on initialized token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Populate-dropdown-based-on-initialized-token/m-p/441842#M29113</link>
      <description>&lt;P&gt;The value that shows is actually the default value.  i confirmed this by setting it to something that the token can't be.  the token value changes based on another selection, but regardless of how i change it, it just shows the default value for that input field.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2019 22:13:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Populate-dropdown-based-on-initialized-token/m-p/441842#M29113</guid>
      <dc:creator>weidertc</dc:creator>
      <dc:date>2019-03-18T22:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: Populate dropdown based on initialized token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Populate-dropdown-based-on-initialized-token/m-p/441843#M29114</link>
      <description>&lt;P&gt;i'll accept this as it's probably the right answer.  I don't think I asked it correctly.  I will start a new thread.&lt;/P&gt;

&lt;P&gt;thanks for your help&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 15:46:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Populate-dropdown-based-on-initialized-token/m-p/441843#M29114</guid>
      <dc:creator>weidertc</dc:creator>
      <dc:date>2019-03-21T15:46:01Z</dc:date>
    </item>
  </channel>
</rss>

