Dashboards & Visualizations

How come the default input change condition is not working?

kjandhyala
Explorer

I have a simple dashboard with two inputs (dropdown and radio).

When "All" is selected in the dropdown, the radio input should be hidden. But, if any other option is selected in the dropdown, then the radio input should be displayed. I tried to use change>condition to set and unset tokens and make the radio input depends on a specific token. I have a condition for the value=* and a default condition of all other values. However, the default condition is NOT working and token "modelselected" is not getting set. Below is my code. I'm printing the token values in a panel.

******* Please help with this urgent request************

<form>
  <label>testtokens2</label>
  <fieldset submitButton="false">
    <input type="dropdown" token="cmselect">
      <label>Car Manufacturer</label>
      <choice value="*">All</choice>
      <choice value="toyota">Toyota</choice>
      <choice value="nissan">Nissan</choice>
      <choice value="chrysler">Chrysler</choice>
      <choice value="gm">GM</choice>
      <choice value="honda">Honda</choice>
      <default>*</default>
      <initialValue>*</initialValue>
      <change>
        <condition value="*">
          <set token="allselected">true</set>
          <unset token="modelselected"></unset>
        </condition>
        <condition>
          <set token="modelselected">true</set>
        </condition>
      </change>
    </input>
    <input type="radio" token="choosemodel" depends="$modelselected$">
      <label>field1</label>
      <choice value="all">All Models</choice>
      <choice value="choose">Choose Models</choice>
      <default>all</default>
      <initialValue>all</initialValue>
    </input>
  </fieldset>
  <row><panel><table><title>allselected token value=$allselected$  modelselected value=$modelselected$</title></table></panel></row>
</form>
0 Karma
1 Solution

briancronrath
Contributor

The wildcard character when used as a value in the condition is a bit wonky. I would just do your condition based off the Label to avoid the weirdness wildcards provide. This should work:

<condition label="All">

View solution in original post

briancronrath
Contributor

The wildcard character when used as a value in the condition is a bit wonky. I would just do your condition based off the Label to avoid the weirdness wildcards provide. This should work:

<condition label="All">

kjandhyala
Explorer

awesome... working great!! Thank you so much.

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...