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!

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 ...