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!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...