Dashboards & Visualizations

How can I have a dropdown in a form that is loaded with only predefined values ?

fere
Path Finder

I need to populate a dropdown box in a form with a list of predefined values (action_value & action_name pairs). This is a fixed set of values that are NOT based on any search. Is there anyway to that?
Thanks in advance

Tags (2)
0 Karma
1 Solution

lguinn2
Legend

In simple XML, use a list of <choice> tags in your input - here is an example

<fieldset>
    <input type="dropdown" token="email">
        <label>Select a user</label>
        <choice value="*">Any</choice>
        <choice value="happy@demo.com">Happy</choice>
        <choice value="sleepy@demp.com">Sleepy</choice>
    </input>
</fieldset>

View solution in original post

lguinn2
Legend

In simple XML, use a list of <choice> tags in your input - here is an example

<fieldset>
    <input type="dropdown" token="email">
        <label>Select a user</label>
        <choice value="*">Any</choice>
        <choice value="happy@demo.com">Happy</choice>
        <choice value="sleepy@demp.com">Sleepy</choice>
    </input>
</fieldset>

smolcj
Builder

what if we need to populate a search for dropdown values in advance xml?

0 Karma

lguinn2
Legend

In advanced XML, you will need to do something like the following, where you create a <list> element for each item in the drop-down list.

  <module name="SearchSelectLister">
    <param name="staticFieldsToDisplay">
      <list>
        <param name="value">*</param>
        <param name="label">Any</param>
      </list>
    </param>
0 Karma

dennywebb
Path Finder

what about in advanced XML?

0 Karma

fere
Path Finder

Thanks, it worked!

0 Karma
Get Updates on the Splunk Community!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...