Dashboards & Visualizations

How to change selected choice of dropdown from another dropdown?

naty
Path Finder

Hi,

i have 2 dropdown's in my form:

  <label>Category to show:</label>
  <choice value="1">test1</choice>
  <choice value="2">test2</choice>
  <choice value="3">test2</choice>
  <change>
    <condition value="1">
      <...set some stuff...>
      <set token="interval">1h</set>
    </condition>
    <condition value="2">
      <...set some stuff...>
      <set token="interval">1h</set>
    </condition>
    <condition value="3">
      <...set some stuff...>
      <set token="interval">1mon</set>
    </condition>
  </change>
</input>
<input type="dropdown" token="interval" searchWhenChanged="true">
  <label>Select Interval:</label>
  <choice value="1h">Hourly</choice>
  <choice value="1mon">Monthly</choice>
  <initialValue>1h</initialValue>
</input>

i am able to change the interval token from the "category" dropdown.
however, when the interval changes, the dropdown does not get updated.

for example -
if i choose "test3" in dropdown "category", the token "interval" changes to 1mon, but it still shows "Hourly".

what i would like to do is - when i change the interval token, i want that the interval dropdown would get updated too.

Hope i was clear enough 🙂

How to do?

Tags (1)
0 Karma
1 Solution

rjthibod
Champion

You need to use the form.interval token instead of just interval in order to show the change in the UI. So, you just need to update all your lines inside the conditionals from <set token="interval" ... to <set token="form.interval" ...

View solution in original post

rjthibod
Champion

You need to use the form.interval token instead of just interval in order to show the change in the UI. So, you just need to update all your lines inside the conditionals from <set token="interval" ... to <set token="form.interval" ...

naty
Path Finder

Thank you!
worked like a charm 😄

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...