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!

Developer Spotlight with Paul Stout

Welcome to our very first developer spotlight release series where we'll feature some awesome Splunk ...

State of Splunk Careers 2024: Maximizing Career Outcomes and the Continued Value of ...

For the past four years, Splunk has partnered with Enterprise Strategy Group to conduct a survey that gauges ...

Data-Driven Success: Splunk & Financial Services

Splunk streamlines the process of extracting insights from large volumes of data. In this fast-paced world, ...