Dashboards & Visualizations

Make Null while changed

Raging_Rags
Engager
<form theme="dark">
  <label>U Clone</label>
  <fieldset submitButton="true">
    <input type="radio" token="field1">
      <label>Select Parameter (Ensure all are null and no spaces)</label>
      <choice value="Email ID">Email</choice>
      <choice value="usrid">External User ID</choice>
      <choice value="wid">W ID</choice>
      <change>
        <condition value="Email ID">
          <set token="inputemail"></set>
          <unset token="tknusr_id">NULL</unset>
          <unset token="tknwid">NULL</unset>
        </condition>
        <condition value="usrid">
          <unset token="inputemail">NULL</unset>
          <set token="tknusr_id"></set>
          <unset token="tknwid">NULL</unset>
        </condition>
        <condition value="wid">
          <unset token="inputemail">NULL</unset>
          <unset token="tknusr_id">NULL</unset>
          <set token="tknwid"></set>
        </condition>
        <condition>
          <unset token="inputemail">NULL</unset>
          <unset token="tknusr_id">NULL</unset>
          <unset token="tknwid">NULL</unset>
        </condition>
      </change>
      <initialValue>Email ID</initialValue>
    </input>
    <input type="text" token="dn" depends="$inputemail$" searchWhenChanged="false">
      <label>Email ID</label>
      <default>NULL</default>
    </input>
    <input type="text" token="usrid" depends="$tknusr_id$" searchWhenChanged="false">
      <label>External User ID</label>
      <default>NULL</default>
    </input>
    <input type="text" token="wid" depends="$tknwid$" searchWhenChanged="false">
      <label>W ID</label>
      <default>NULL</default>

Above is my code for inputs. A dynamic radio button setup. I want to make the values which are not selected. If the user enters a value and makes a search with it and when he wants to search with a different value, the other two should become null.

 

Eg; Primarily Users searches email_id and then searches with wi, the email_id should become null. only the results for respective wid should be displayed.

 

Thanks in Advance!

0 Karma

htrednek
Explorer

To set a null token don't use UNSET.  Your searches will not run and will say they're waiting for input because they'll still have $tokenname$ sitting there.  Set an empty token instead.  <set token="xyz"></set>

Example: When you unset a menu, also set it's token value.

<form theme="dark">
  <label>U Clone</label>
  <fieldset submitButton="true">
    <input type="radio" token="field1">
      <label>Select Parameter (Ensure all are null and no spaces)</label>
      <choice value="Email ID">Email</choice>
      <choice value="usrid">External User ID</choice>
      <choice value="wid">W ID</choice>
      <change>
        <condition value="Email ID">
          <set token="inputemail"></set>
          <unset token="tknusr_id"></unset>
          <set token="usrid"></set>
          <unset token="tknwid"></unset>
          <set token="wid"></set>
        </condition>
        <condition value="usrid">
          <unset token="inputemail"></unset>
          <set token="dn"></set>
          <set token="tknusr_id"></set>
          <unset token="tknwid"></unset>
          <set token="wid"></set>
        </condition>
        <condition value="wid">
          <unset token="inputemail"></unset>
          <set token="dn"></set>
          <unset token="tknusr_id"></unset>
          <set token="usrid"></set>
          <set token="tknwid"></set>
        </condition>
        <condition>
          <unset token="inputemail">NULL</unset>
          <unset token="tknusr_id">NULL</unset>
          <unset token="tknwid">NULL</unset>
        </condition>
      </change>
      <initialValue>Email ID</initialValue>
    </input>
    <input type="text" token="dn" depends="$inputemail$" searchWhenChanged="false">
      <label>Email ID</label>
      <default>NULL</default>
    </input>
    <input type="text" token="usrid" depends="$tknusr_id$" searchWhenChanged="false">
      <label>External User ID</label>
      <default>NULL</default>
    </input>
    <input type="text" token="wid" depends="$tknwid$" searchWhenChanged="false">
      <label>W ID</label>
      <default>NULL</default>

   

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Not sure if it will help, but the set directive should have an argument whereas unset should have no argument.

        <condition value="usrid">
          <unset token="inputemail"></unset>
          <set token="tknusr_id">true</set>
          <unset token="tknwid"></unset>
        </condition>

 

---
If this reply helps you, Karma would be appreciated.
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...