Assuming that:
1) trialsField has trials value
2) testsField has test values
3) trialsToken gets set when the value is selected by trialsDropdown
4) testsToken gets set when the value is selected by testsDropdown
Try below:
This dropdown below populates the list with trialsField and whatever user will select, the value of trialsField will be saved in trialsToken. "All" is kept as default value which will set "*" as a value.
<input type="dropdown" token="trialsToken" searchWhenChanged="true">
<label>Trials Lable</label>
<search>
<query>query that populates the trials list | stats count by trialsField| table trialsField</query>
<earliest>earliest time for query</earliest>
<latest>latest time for query</latest>
</search>
<fieldForLabel>trialsField</fieldForLabel>
<fieldForValue>trialsField</fieldForValue>
<choice value="*">All</choice>
</input>
Once the value of trialsField is received in trialsToken then this is used in the second dropdown, where:
testsPrefix is evaluated from the testsFields i.e. "1" is extracted from testsField="1A"
this testsPrefix is matched with trialsToken so you only receive "1A, 1B..." and populate the testsFields
Test Lable
your Query to bring up the testsFields | eval testsPrefix=substr(testsField,1,1)| search testsPrefix="$trialsToken$"| stats count by testsField| table testsField
earliest time for query
latest time for query
testsField
testsField
All
You can choose the desired substring indexes substr(testsField,1,1) as this one is actually taking out "1" out of "1A"
Also testsToken and trialsToken can then be used in other searches as well.
... View more