Dashboards & Visualizations

DASHBOARD Checkbox with ALL option-- All panels should be visible

sagar1992
Explorer

Hi Team,

I was able to link each checkbox to each panel with below approach:

`

Reports
showPanel2
showPanel2

`

Now I would like to have ALL as an option.

How can I link one checkbox with all panels?

I don't want to use Javascript/CSS. just basic configuration should do.

I also tried below but it is not working. copying token to all panels.

<panel id="panel2" depends=**"$showPanel2$,$ALL$"**>

screenshot below:
alt text

0 Karma
1 Solution

niketn
Legend

@sagar1992 try the following run anywhere example and confirm whether it suits the needs.

<form>
  <label>CheckBox All</label>
  <fieldset submitButton="false"></fieldset>
  <row>
    <panel>
      <input type="checkbox" token="tokAllReports">
        <label>All</label>
        <choice value="all_reports">Reports</choice>
        <change>
          <condition value="all_reports">
            <!-- Set all other checkboxes to show all reports -->
            <set token="form.tokMonthlyReports">monthly_reports</set>
            <set token="form.tokDailyReports">daily_reports</set>
          </condition>
          <condition>
            <!-- Unset all other checkboxes to hide all reports -->
            <unset token="form.tokMonthlyReports"></unset>
            <unset token="form.tokDailyReports"></unset>
          </condition>
        </change>
      </input>
      <input type="checkbox" token="tokMonthlyReports">
        <label></label>
        <choice value="monthly_reports">Monthly Reports</choice>
        <change>
          <condition value="monthly_reports">
            <!-- Show monthly report -->
            <set token="tokShowPanelMonthly">true</set>
          </condition>
          <condition>
            <!-- Hide monthly report -->
            <unset token="tokShowPanelMonthly"></unset>
          </condition>
        </change>
      </input>
      <input type="checkbox" token="tokDailyReports">
        <label></label>
        <choice value="daily_reports">Daily Reports</choice>
        <change>
          <condition value="daily_reports">
            <!-- Show daily report -->
            <set token="tokShowPanelDaily">true</set>
          </condition>
          <condition>
            <!-- Hide daily report -->
            <unset token="tokShowPanelDaily"></unset>
          </condition>
        </change>
      </input>
    </panel>
  </row>
  <row>
    <panel id="panelMonthly" depends="$tokShowPanelMonthly$">
      <html>
        <div>
          <h3>Monhtly Report Panel</h3>
        </div>
      </html>
    </panel>
    <panel id="panelDaily" depends="$tokShowPanelDaily$">
      <html>
        <div>
          <h3>Daily Report Panel</h3>
        </div>
      </html>
    </panel>
  </row>
</form>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

0 Karma

niketn
Legend

@sagar1992 try the following run anywhere example and confirm whether it suits the needs.

<form>
  <label>CheckBox All</label>
  <fieldset submitButton="false"></fieldset>
  <row>
    <panel>
      <input type="checkbox" token="tokAllReports">
        <label>All</label>
        <choice value="all_reports">Reports</choice>
        <change>
          <condition value="all_reports">
            <!-- Set all other checkboxes to show all reports -->
            <set token="form.tokMonthlyReports">monthly_reports</set>
            <set token="form.tokDailyReports">daily_reports</set>
          </condition>
          <condition>
            <!-- Unset all other checkboxes to hide all reports -->
            <unset token="form.tokMonthlyReports"></unset>
            <unset token="form.tokDailyReports"></unset>
          </condition>
        </change>
      </input>
      <input type="checkbox" token="tokMonthlyReports">
        <label></label>
        <choice value="monthly_reports">Monthly Reports</choice>
        <change>
          <condition value="monthly_reports">
            <!-- Show monthly report -->
            <set token="tokShowPanelMonthly">true</set>
          </condition>
          <condition>
            <!-- Hide monthly report -->
            <unset token="tokShowPanelMonthly"></unset>
          </condition>
        </change>
      </input>
      <input type="checkbox" token="tokDailyReports">
        <label></label>
        <choice value="daily_reports">Daily Reports</choice>
        <change>
          <condition value="daily_reports">
            <!-- Show daily report -->
            <set token="tokShowPanelDaily">true</set>
          </condition>
          <condition>
            <!-- Hide daily report -->
            <unset token="tokShowPanelDaily"></unset>
          </condition>
        </change>
      </input>
    </panel>
  </row>
  <row>
    <panel id="panelMonthly" depends="$tokShowPanelMonthly$">
      <html>
        <div>
          <h3>Monhtly Report Panel</h3>
        </div>
      </html>
    </panel>
    <panel id="panelDaily" depends="$tokShowPanelDaily$">
      <html>
        <div>
          <h3>Daily Report Panel</h3>
        </div>
      </html>
    </panel>
  </row>
</form>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

sagar1992
Explorer

Hello @niketnilay,
added below tags according to my needs, and it worked.

<input type="checkbox" token="tokAllReports" searchWhenChanged="true">
         <label>All</label>
         <choice value="all_reports">All Reports</choice>
         <change>
           <condition value="all_reports">
             <!-- Set all other checkboxes to show all reports -->
             <set token="form.showPanel1">monthly_reports</set>
             <set token="form.showPanel5">daily_reports</set>
             <set token="form.showPanel2">monthly_reports</set>
             <set token="form.showPanel6">daily_reports</set>
             <set token="form.showPanel3">monthly_reports</set>
             <set token="form.showPanel4">monthly_reports</set>
           </condition>
           <condition>
             <!-- Unset all other checkboxes to hide all reports -->
             <unset token="form.showPanel1"></unset>
             <unset token="form.showPanel5"></unset>
             <unset token="form.showPanel2"></unset>
             <unset token="form.showPanel6"></unset>
             <unset token="form.showPanel3"></unset>
             <unset token="form.showPanel4"></unset>
           </condition>
         </change>
       </input>

Thank you so much!! looks good. 🙂
Happy Sunday.
:)

niketn
Legend

Happy Weekend to you too!

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

Harnessing Splunk’s Federated Search for Amazon S3

Managing your data effectively often means balancing performance, costs, and compliance. Splunk’s Federated ...

Infographic provides the TL;DR for the 2024 Splunk Career Impact Report

We’ve been buzzing with excitement about the recent validation of Splunk Education! The 2024 Splunk Career ...

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...