<?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 to go about dropdown default value based on another dropdown? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-go-about-dropdown-default-value-based-on-another-dropdown/m-p/624281#M51184</link>
    <description>&lt;P&gt;This was interesting, I tried some variations of your approach but the old choice still stays&lt;/P&gt;</description>
    <pubDate>Wed, 14 Dec 2022 21:02:00 GMT</pubDate>
    <dc:creator>Gabri</dc:creator>
    <dc:date>2022-12-14T21:02:00Z</dc:date>
    <item>
      <title>How to go about dropdown default value based on another dropdown?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-go-about-dropdown-default-value-based-on-another-dropdown/m-p/624274#M51182</link>
      <description>&lt;P&gt;I have the following dropdowns, now if I select test1 and then test11 in the second dropdown, when I change the first one to be test2, the second dropdown holds the old value and shows test11 although that's not a valid option.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;form version="1.1" theme="dark"&amp;gt;
  &amp;lt;fieldset&amp;gt;
    &amp;lt;input type="dropdown" token="test"&amp;gt;
      &amp;lt;label&amp;gt;Test&amp;lt;/label&amp;gt;
      &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="test1"&amp;gt;test1&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="test2"&amp;gt;test2&amp;lt;/choice&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="dropdown" token="dependsontest" searchWhenChanged="false"&amp;gt;
      &amp;lt;label&amp;gt;DependsOnTest&amp;lt;/label&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;$test$&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;$test$&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;| makeresults
| fields - _time
| eval test1="test11,test12",test2="test21,test22" 
| fields $test$
| makemv $test$ delim=","
| mvexpand $test$&amp;lt;/query&amp;gt;
      &amp;lt;/search&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;/fieldset&amp;gt;
&amp;lt;/form&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I tried the &amp;lt;selectFirstChoice&amp;gt;true&amp;lt;/selectFirstChoice&amp;gt; and default values but those didn't work. How can I go about this ?&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;EDIT: &lt;/STRONG&gt;I tried using the "change" and "condition" and found out that the "dependsontest" token gets updated but the dropdown UI doesn't.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2022 14:57:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-go-about-dropdown-default-value-based-on-another-dropdown/m-p/624274#M51182</guid>
      <dc:creator>Gabri</dc:creator>
      <dc:date>2022-12-15T14:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to go about dropdown default value based on another dropdown?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-go-about-dropdown-default-value-based-on-another-dropdown/m-p/624277#M51183</link>
      <description>&lt;P&gt;As an untested idea, try adding code to unset the second token when the first one changes.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;form version="1.1" theme="dark"&amp;gt;
  &amp;lt;fieldset&amp;gt;
    &amp;lt;input type="dropdown" token="test"&amp;gt;
      &amp;lt;label&amp;gt;Test&amp;lt;/label&amp;gt;
      &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="test1"&amp;gt;test1&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="test2"&amp;gt;test2&amp;lt;/choice&amp;gt;
      &amp;lt;change&amp;gt;
         &amp;lt;unset token="dependsontest"/&amp;gt;
      &amp;lt;/change&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="dropdown" token="dependsontest" searchWhenChanged="false"&amp;gt;
      &amp;lt;label&amp;gt;DependsOnTest&amp;lt;/label&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 14 Dec 2022 20:04:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-go-about-dropdown-default-value-based-on-another-dropdown/m-p/624277#M51183</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-12-14T20:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to go about dropdown default value based on another dropdown?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-go-about-dropdown-default-value-based-on-another-dropdown/m-p/624281#M51184</link>
      <description>&lt;P&gt;This was interesting, I tried some variations of your approach but the old choice still stays&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2022 21:02:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-go-about-dropdown-default-value-based-on-another-dropdown/m-p/624281#M51184</guid>
      <dc:creator>Gabri</dc:creator>
      <dc:date>2022-12-14T21:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to go about dropdown default value based on another dropdown?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-go-about-dropdown-default-value-based-on-another-dropdown/m-p/624381#M51192</link>
      <description>&lt;P&gt;I think I found the underlying issue but not a solution for it. I used a "change" like richgalloway suggested and the actual token gets updated but the dropdown UI still shows a stale value.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2022 14:56:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-go-about-dropdown-default-value-based-on-another-dropdown/m-p/624381#M51192</guid>
      <dc:creator>Gabri</dc:creator>
      <dc:date>2022-12-15T14:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to go about dropdown default value based on another dropdown?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-go-about-dropdown-default-value-based-on-another-dropdown/m-p/624391#M51193</link>
      <description>&lt;P&gt;Here is what I was trying before, where the "dependsontest" token would get updated but the UI would show a stale value.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;      &amp;lt;change&amp;gt;
          &amp;lt;set token="dependsontest"&amp;gt;All&amp;lt;/set&amp;gt;
      &amp;lt;/change&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what I am doing now and it updates both the token AND the UI&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;      &amp;lt;change&amp;gt;
          &amp;lt;set token="form.dependsontest"&amp;gt;All&amp;lt;/set&amp;gt;
      &amp;lt;/change&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 15 Dec 2022 15:15:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-go-about-dropdown-default-value-based-on-another-dropdown/m-p/624391#M51193</guid>
      <dc:creator>Gabri</dc:creator>
      <dc:date>2022-12-15T15:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to go about dropdown default value based on another dropdown?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-go-about-dropdown-default-value-based-on-another-dropdown/m-p/655386#M53914</link>
      <description>&lt;P&gt;Can this be done in Dashboard Studio JSON configuration?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2023 17:13:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-go-about-dropdown-default-value-based-on-another-dropdown/m-p/655386#M53914</guid>
      <dc:creator>astockmeister_s</dc:creator>
      <dc:date>2023-08-23T17:13:20Z</dc:date>
    </item>
  </channel>
</rss>

