Dashboards & Visualizations

How to use text box to dynamically display extra information on my dashboard when selecting from dropdown menu?

cchange
Path Finder

Hi,

I would like to display some extra information beside my dropdown on my dashboard. When I select from dropdown menu, it should be displayed dynamically. I used dropdown and text box to get this but no luck. Any inputs are appreciated.

alt text

Thanks

0 Karma

gokadroid
Motivator

Let me give it a shot taking these assumptions below:

1) You have a query that will return you two fields;

  • first field whose values you want to update as part of dropDown list. I will call this field thisWillBeDisplayedInDropDown
  • second field whose values you want to update in the text box depending on what user chose in dropdown list. I will call this field as thisWillBeUpdatedInTextBox

Example of one such query can be:
base query | stats count by thisWillBeDisplayedInDropDown, thisWillBeUpdatedInTextBox

You can then use "thisWillBeDisplayedInDropDown" field values to display in drop down list and depending on what value user selected, the value of "thisWillBeUpdatedInTextBox" field will be used to update in the textbox.

Taking above as a reference, please have a look at this code which should give you what you want:

<form>
  <label>Dashboard Title</label>
  <fieldset submitButton="false">
    <input type="dropdown" token="thisIsDropdownToken">
      <label>This is DropDown Label</label>
      <search>
        <query>This query will populate the dropdown| stats count  by thisWillBeDisplayedInDropDown, thisWillBeUpdatedInTextBox</query>
        <earliest>-4h@m</earliest>
        <latest>now</latest>
      </search>
      <fieldForLabel>thisWillBeDisplayedInDropDown</fieldForLabel>
      <fieldForValue>thisWillBeUpdatedInTextBox</fieldForValue>
    </input>
    <input type="text" token="thisIsTextBoxToken">
      <label>This textBox's text will change</label>
      <default>$thisIsDropdownToken$</default>
    </input>
  </fieldset>
</form>

NOTE: Please ensure to click "Search On Change" in both the TextBox and DropDown Input settings when you are configuring the Inputs (just being cautious )

cchange
Path Finder

Below logic didn't work. I tried in other way and achieved solution by creating a panel and showed static values depend upon the selection from drop down.

0 Karma

cchange
Path Finder

Thanks for your input. But I'm not looking this functionality. I'm looking to display static text as more info when I select a dropdown right to that. For ex: If I select 2016 from drop down extra message should be displayed right to the drop down like "It is a Year". If I select another value it should populate another message w.r.t that.

2016
July

if(eval $dd$=2016) It is a Year
if(eval $dd$=July) Month

0 Karma

gokadroid
Motivator

That should be easier if you already know what static values you have and what static values you want to output when user selects. Try this then:

<form>
  <label>Answers</label>
  <fieldset submitButton="false">
    <input type="dropdown" token="thisIsDropdownToken" searchWhenChanged="true">
      <label>This is DropDown Label</label>
      <choice value="It is a year">2016</choice>
      <choice value="It is a year">2017</choice>
      <choice value="Month">July</choice>
      <choice value="Month">June</choice>
    </input>
    <input type="text" token="thisIsTextBoxToken">
      <label>This textBox's text will change</label>
      <default>$thisIsDropdownToken$</default>
    </input>
  </fieldset>
</form>
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!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...