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
Get Updates on the Splunk Community!

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...