Dashboards & Visualizations

Dashboard - Valorize a token based on match condition

edoardo_vicendo
Builder

Hello,

 

I am trying to set-up a ShowPanel token that I will use later on in the dashboard in this way:

 

<panel depends="$ShowPanel$">

 

 

Here is how I am setting it up

 

    <input type="dropdown" token="tok_usecase" searchWhenChanged="true">
      <label>Use Case</label>
      <choice value="&quot;01&quot;">Use Case 01</choice>
      <choice value="&quot;02&quot;">Use Case 02</choice>
      <choice value="&quot;03&quot;">Use Case 03</choice>
      <choice value="&quot;04&quot;">Use Case 04</choice>
      <choice value="&quot;05&quot;">Use Case 05</choice>
      <choice value="&quot;06&quot;">Use Case 06</choice>
      <default>"01"</default>
      <initialValue>"01"</initialValue>
      <change>
        <condition match="$tok_usecase$==&quot;05&quot;">
          <set token="ShowPanel">true</set>
          <unset token="tok_audit"></unset>
          <unset token="tok_taskID"></unset>
          <unset token="tok_sessID"></unset>
        </condition>
        <condition match="$tok_usecase$!=&quot;05&quot;">
          <unset token="ShowPanel"></unset>
          <unset token="tok_audit"></unset>
          <unset token="tok_taskID"></unset>
          <unset token="tok_sessID"></unset>
        </condition>
      </change>
    </input>

 

 

but it seems the $ShowPanel$ token is not valorized. I tried to print it in the panel title but it appears as $ShowPanel$ instead of having the value equal to "true".

Do you know where the error is?

Thanks a lot,

Edoardo

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

somesoni2
Revered Legend

Gi

    <input type="dropdown" token="tok_usecase" searchWhenChanged="true">
      <label>Use Case</label>
      <choice value="&quot;01&quot;">Use Case 01</choice>
      <choice value="&quot;02&quot;">Use Case 02</choice>
      <choice value="&quot;03&quot;">Use Case 03</choice>
      <choice value="&quot;04&quot;">Use Case 04</choice>
      <choice value="&quot;05&quot;">Use Case 05</choice>
      <choice value="&quot;06&quot;">Use Case 06</choice>
      <default>"01"</default>
      <initialValue>"01"</initialValue>
      <change>
        <condition label="Use Case 05">
          <set token="ShowPanel">true</set>
          <unset token="tok_audit"></unset>
          <unset token="tok_taskID"></unset>
          <unset token="tok_sessID"></unset>
        </condition>
        <condition match="true()">
          <unset token="ShowPanel"></unset>
          <unset token="tok_audit"></unset>
          <unset token="tok_taskID"></unset>
          <unset token="tok_sessID"></unset>
        </condition>
      </change>
    </input>

ve this a try

 

View solution in original post

somesoni2
Revered Legend

Gi

    <input type="dropdown" token="tok_usecase" searchWhenChanged="true">
      <label>Use Case</label>
      <choice value="&quot;01&quot;">Use Case 01</choice>
      <choice value="&quot;02&quot;">Use Case 02</choice>
      <choice value="&quot;03&quot;">Use Case 03</choice>
      <choice value="&quot;04&quot;">Use Case 04</choice>
      <choice value="&quot;05&quot;">Use Case 05</choice>
      <choice value="&quot;06&quot;">Use Case 06</choice>
      <default>"01"</default>
      <initialValue>"01"</initialValue>
      <change>
        <condition label="Use Case 05">
          <set token="ShowPanel">true</set>
          <unset token="tok_audit"></unset>
          <unset token="tok_taskID"></unset>
          <unset token="tok_sessID"></unset>
        </condition>
        <condition match="true()">
          <unset token="ShowPanel"></unset>
          <unset token="tok_audit"></unset>
          <unset token="tok_taskID"></unset>
          <unset token="tok_sessID"></unset>
        </condition>
      </change>
    </input>

ve this a try

 

edoardo_vicendo
Builder

Thank you so much, it works!

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...