Dashboards & Visualizations

How to remove a token name when the token has no value?

morethanyell
Builder

We're working on an HTML table with <td> that displays value of token (such that <td>$token1$</td>). We don't know how to remove the token name $token1$ when we deselect from the inputfield. Here's a clearer picture:

alt text

But when we deselect, the token name appears! How do we solve this?

alt text

Thanks in advance!

0 Karma
1 Solution

niketn
Legend

@morethanyell please add the following change event handler to your Dropdown input and test.

  <change>
    <condition match="isnull($value$)">
      <set token="token1"></set>
      <set token="token2"></set>          
    </condition>
    <condition>
      <set token="token1">$label$</set>
      <set token="token2">$value$</set>
    </condition>
  </change>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

niketn
Legend

@morethanyell please add the following change event handler to your Dropdown input and test.

  <change>
    <condition match="isnull($value$)">
      <set token="token1"></set>
      <set token="token2"></set>          
    </condition>
    <condition>
      <set token="token1">$label$</set>
      <set token="token2">$value$</set>
    </condition>
  </change>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

bgennerm
Engager

you can even do this with the same token:



if(isnull($value$),"blank or other text", $token1$)


harishalipaka
Motivator

hi @morethanyell

If you want to blank that cell when it has no value ,dynamically add blank for token value when it is null.

Thanks
Harish

morethanyell
Builder

how is this done? sorry i'm new.

0 Karma
Get Updates on the Splunk Community!

3 Ways to Make OpenTelemetry Even Better

My role as an Observability Specialist at Splunk provides me with the opportunity to work with customers of ...

What's New in Splunk Cloud Platform 9.2.2406?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.2.2406 with many ...

Enterprise Security Content Update (ESCU) | New Releases

In August, the Splunk Threat Research Team had 3 releases of new security content via the Enterprise Security ...