Use dynamic form search to autopopulate a set of radio buttons or drop down list with results from a search. To populate the radio button or drop down options, write a search to run every time you load the page. Or, if you don't want to rerun your search every time you load the page, you can use a saved search to populate drop down list or radio button options.
Make sure you already understand how to build a simple form search -- dynamic form searches build on top of the simple form search structure.
You've already configured a form search as described in the simple form search documentation. Now, just change the inputtype to either dropdown or radiobutton.
For example, to configure a dropdown:
<form>
<label>My form search</label>
<searchTemplate>$username$</searchTemplate>
<fieldset>
<input type= dropdown/>
MORE CONFIGURATION OPTIONS GO HERE (see below)
</fieldset>
<row>
<table>
<title>Users</title>
<option name="showPager">true</option>
</table>
</row>
</form>
If you want to configure a radio button form search, just specify radio. For example:
<form>
<label>My form search</label>
<searchTemplate>$username$</searchTemplate>
<fieldset>
<input type= radio/>
MORE CONFIGURATION OPTIONS GO HERE (see below)
</fieldset>
<row>
<table>
<title>Users</title>
<option name="showPager">true</option>
</table>
</row>
</form>
There are more configuration options you'll want to set for your dropdown or radio buttons. For example, a label to appear next to the dropdown or radio buttons, the search to populate the results, etc. None of these options are required by the input type, but you're not going to have a very useful dropdown or radio button set unless you specify some of these. Here are all your options for configuration:
<input type="dropdown" token="username">
<label>Select Name</label>
<populatingSearch fieldForValue="suser" fieldForLabel="suser"><![CDATA[sourcetype=p4change | rex "user=(?<suser>\w+)@"
| stats count by suser]]></populatingSearch>
<default>nagrin</default>
<choice value="*">Any</choice>
</input>
<input type="radio" token="username">
<label>Select Name</label>
<populatingSearch fieldForValue="suser" fieldForLabel="suser"><![CDATA[sourcetype=p4change | rex "user=(?<suser>\w+)@"
| stats count by suser]]></populatingSearch>
<choice value="*">Any</choice>
</input>
Categories: V:4.0.5 | V:4.0.6 | V:4.1beta | V:4.0.7