Dashboards & Visualizations

default value for dropdown

surekhasplunk
Communicator

I have set default values for dropdown as all and have set as panel condition
Then i have a readio button for selection of both which i have set for table condition.
Now when i first time load my dashboard then by default i want to see all my panels which is not working
first i have to change value in the dropdown then only it starts working
Has anyone faced this issue ?

Tags (3)
0 Karma
1 Solution

niketn
Legend

@surekhasplunk, I can not see default value being set for either dropdown or radio. Can you please confirm whether you are defaulting these on form load or not?

Also your table is depended on token $run$, which I am not sure as to how the same is set.

If you are on Splunk 6.5 or higher, you can use <init> section in Simple XML to set some default values for required tokens on form load

<init>
    <set token="dropuk">1</set>
    <set token="button">...
    ...
</init>

Refer to Splunk documentation: http://docs.splunk.com/Documentation/SplunkCloud/latest/Viz/tokens#Guidelines

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

0 Karma

niketn
Legend

@surekhasplunk, I can not see default value being set for either dropdown or radio. Can you please confirm whether you are defaulting these on form load or not?

Also your table is depended on token $run$, which I am not sure as to how the same is set.

If you are on Splunk 6.5 or higher, you can use <init> section in Simple XML to set some default values for required tokens on form load

<init>
    <set token="dropuk">1</set>
    <set token="button">...
    ...
</init>

Refer to Splunk documentation: http://docs.splunk.com/Documentation/SplunkCloud/latest/Viz/tokens#Guidelines

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

surekhasplunk
Communicator

Cheers !!! this init method worked

0 Karma

niketn
Legend

Glad it worked!!! I have converted to Answer. Please accept! 🙂

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

niketn
Legend

@surekhasplunk, is the searchWhenChanged set to false? Can you share dashboard code?

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

surekhasplunk
Communicator
<input type="dropdown" token="dropregion" searchWhenChanged="true">
  <label>REGION</label>
   <choice value="ALL">ALL</choice>
    <condition match="$dropregion$==&quot;ALL&quot;">
      <set token="dropuk">1</set>
      <set token="dropemea">1</set>
      <set token="dropapac">1</set>
      <set token="dropindia">1</set>
      <set token="dropglobal">1</set>
    </condition>
    <condition match="$dropregion$==&quot;UK&quot;">
      <set token="dropuk">1</set>

....

This token i have set as condition of panel dependent

<input type="radio" token="button" searchWhenChanged="true">
  <label>RUN/CHANGE BANK</label>

This token is set for table dependent.

<panel depends="$dropuk$">
  <title>RTB</title>
  <table depends="$run$">
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...