Dashboards & Visualizations

How to only show drilldown panels on matching dropdown page?

michaeler
Communicator

My dashboard has about 45 panels split between 8 pages using a dropdown. I am adding drilldowns that open panels that are hidden until a user clicks on a chart or table. My issue is that when I'm on a certain page and click on a visualization and the hidden panel appears, it remains displayed when I switch to a different page.

I can't copy and paste my code so here's a snippet of what I have:

<form>
  <label>My Dashboard</label>
  <fieldset submitButton="false">
    <input type="dropdown" token="type" searchWhenChanged="true">
      <label>Select Page</label>
      <choice value="A">A</choice>
      .......same for B-G.......
      <choice value="H">H</choice>
      <change>
        <condition value="A">
          <set token="A_panel">true</set>
          <unset token="B_panel"></unset>
           ......unset C-H......
        </condition>
        <condition value="B">
          <set token="B">true</set>
          <unset token="A_panel"></unset>
          ......unset C-H......
        </condition>
        <condition>
          .....Repeat for C-H.....
        </condition>
      </change>
    </input>
  </fieldset>
  <row>
    <panel depends="$A_panel$">
      <title>Panel A1</title>
      <table>
        <search>
          <query>| index=* App=* Status="Down" | table App A B C </query>
          <earliest>0</earliest>
          <latest></latest>
        </search>
        <option name="drilldown">cell</option>
        <drilldown>
          <set token="show_panel_A1">true</set>
          <set token="selected_app">$click.value$</set>
          <eval token="drilldown.earliest">case($click.name2$=="30 Days", "-30d", $click.name2$=="60 Days", "-60d")
          <eval token="drilldown.latest">case($click.name2$=="30 Days", "now", $click.name2$=="60 Days", "-30d")
        <drilldown>
      </table>
    </panel>
  </row>
  <row>
    <panel depends="$show_panel_A1$">
      <title>Count for $selected_app$</title>
      <chart>
        <search>
          <query>| index=* App=* Status="Down" earliest=$drilldown.earliest$ latest=$drilldown.latest$ | search App="$selected_app$" | timechart count by App </query>
        </search>
      </chart>
    </panel>
  </row>

I've tried adding the <unset token> for other drilldown panels under <drilldown> and <condition value=""> sections but the panels don't hide again after I select a different drilldown or move pages.

Labels (5)
Tags (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Try putting the depends on the rows

  <row depends="$A_panel$">
    <panel>

  <row depends="$A_panel$">
    <panel depends="$show_panel_A1$">

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust

Try putting the depends on the rows

  <row depends="$A_panel$">
    <panel>

  <row depends="$A_panel$">
    <panel depends="$show_panel_A1$">

michaeler
Communicator

I was certain I tried this already and received an error about redefining 'depends' but I tried it again anyways it it worked! 

I'm glad the answer is simple and easy to implement but disappointed I didn't try this already...

0 Karma
Get Updates on the Splunk Community!

Aligning Observability Costs with Business Value: Practical Strategies

 Join us for an engaging Tech Talk on Aligning Observability Costs with Business Value: Practical ...

Mastering Data Pipelines: Unlocking Value with Splunk

 In today's AI-driven world, organizations must balance the challenges of managing the explosion of data with ...

Splunk Up Your Game: Why It's Time to Embrace Python 3.9+ and OpenSSL 3.0

Did you know that for Splunk Enterprise 9.4, Python 3.9 is the default interpreter? This shift is not just a ...