Dashboards & Visualizations

Why does the Dynamic content Drop-Down auto clears unexpectedly?

altink
Builder

Dear All

I have a problem with a "slave" Drop-Down (field-scan_run_id) whose option values are set dynamically according to value chosen in another "master" Drop-Down (field_db_name).
The "slave" drop down auto-clears after I choose a value on it - practically I cannot set anything on it!

The code is below:

<form>
  <label>Scan Compare 002</label>
  <fieldset submitButton="false" autoRun="false">
    <input type="time" token="field1">
      <label>Time</label>
      <default>
        <earliest>-30d@d</earliest>
        <latest>now</latest>
      </default>
    </input>
    <input type="dropdown" token="field_db_name" searchWhenChanged="true">
      <label>Database</label>
      <fieldForLabel>DB_NAME</fieldForLabel>
      <fieldForValue>DB_NAME</fieldForValue>
      <search>
        <query>index=omega_ds | DEDUP DB_NAME | FIELDS DB_NAME</query>
        <earliest>$field1.earliest$</earliest>
        <latest>$field1.latest$</latest>
      </search>
      <change>
         <unset token="form.field_scan_run_id"></unset>
      </change>
      <selectFirstChoice>true</selectFirstChoice>
      <prefix>"</prefix>
      <suffix>"</suffix>
    </input>
    <input type="dropdown" token="field_scan_run_id" searchWhenChanged="true">
      <label>Scan Id Run</label>
      <search>
        <query>index=omega_ds  
DB_NAME=$field_db_name$
| stats 
earliest(_time) as SCAN_DT_START
by DB_NAME SCAN_ID
| sort - SCAN_DT_START</query>
        <earliest>$field1.earliest$</earliest>
        <latest>$field1.latest$</latest>
      </search>
      <fieldForLabel>SCAN_ID</fieldForLabel>
      <fieldForValue>SCAN_ID</fieldForValue>
      <prefix>"</prefix>
      <suffix>"</suffix>
    </input>
  </fieldset>
</form>

I noticed that if I remove the

 <change>
             <unset token="form.field_scan_run_id"></unset>
          </change>

at "master" input field_db_name - the problem goes.

But I need to clear the existing value of the "slave" value since it will keep the old value which will be sure NOT be present in the new range of options changed by the chosen value in "master".

can someone please advise?

best regards
Altin

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!

Persistent Queue at TcpOut — One of Splunk's Most Practical Features

Splunk introduced persistent queueing at the tcpout layer as one of the most practical resilience features in ...

Skip the Awkward Silence: Have a .conf-ersation at .conf26

Picture this. You arrive at .conf26 already having your socializing and networking plans mapped out. No ...

Rethinking Zero Trust: From Product Purchases to Logical Control Evidence

Implementing Zero Trust (ZT) across complex environments often falters at the very beginning due to a ...