- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
smanojkumar
Contributor
11-11-2024
03:18 AM
Hello Splunkers,
I have created a input dropdown where i need to reset all input drodpdown irrespective of the selections made to the default value of the fields.
Here i can chnage the values that were passed to the search but I weren't unable to change the values that were present in input dropdown.
<input type="radio" token="field3" searchWhenChanged="true">
<label>Condition_1</label>
<choice value="=">Contains</choice>
<choice value="!=">Does Not Contain</choice>
<default>=</default>
<initialValue>=</initialValue>
</input>
<input type="text" token="search" searchWhenChanged="true">
<label>All Fields Search_1</label>
<default>*</default>
<initialValue>*</initialValue>
<prefix>"*</prefix>
<suffix>*"</suffix>
</input>
<input type="checkbox" token="field4">
<label>Add New Condition</label>
<choice value="1">Yes</choice>
</input>
<input type="dropdown" token="field5" searchWhenChanged="true" depends="$field4$" rejects="$reset_all_field_search$">
<label>Expression</label>
<choice value="AND">AND</choice>
<choice value="OR">OR</choice>
<default>AND</default>
<initialValue>AND</initialValue>
</input>
<input type="radio" token="field6" searchWhenChanged="true" depends="$field4$" rejects="$reset_all_field_search$">
<label>Condition_2</label>
<choice value="=">Contains</choice>
<choice value="!=">Does Not Contain</choice>
<default>=</default>
<initialValue>=</initialValue>
</input>
<input type="text" token="search2" searchWhenChanged="true" depends="$field4$" rejects="$reset_all_field_search$">
<label>All Fields Search_2</label>
<default>*</default>
<initialValue>*</initialValue>
<prefix>"*</prefix>
<suffix>*"</suffix>
</input>
<input type="checkbox" token="field14" depends="$field4$">
<label>Add New Condition</label>
<choice value="1">Yes</choice>
</input>
<input type="dropdown" token="field15" searchWhenChanged="true" depends="$field14$" rejects="$reset_all_field_search$">
<label>Expression</label>
<choice value="AND">AND</choice>
<choice value="OR">OR</choice>
<default>AND</default>
<initialValue>AND</initialValue>
</input>
<input type="radio" token="field16" searchWhenChanged="true" depends="$field14$" rejects="$reset_all_field_search$">
<label>Condition_3</label>
<choice value="=">Contains</choice>
<choice value="!=">Does Not Contain</choice>
<default>=</default>
<initialValue>=</initialValue>
</input>
<input type="text" token="search12" searchWhenChanged="true" depends="$field14$" rejects="$reset_all_field_search$">
<label>All Fields Search_3</label>
<default>*</default>
<initialValue>*</initialValue>
<prefix>"*</prefix>
<suffix>*"</suffix>
</input>
<input type="checkbox" token="reset_all_field_search" searchWhenChanged="true">
<label>Reset All field search</label>
<choice value="reset_all_field_search">Yes</choice>
<delimiter> </delimiter>
<change>
<condition value="reset_all_field_search">
<unset token="search"></unset>
<set token="search">*</set>
<unset token="search2"></unset>
<set token="search2">*</set>
<unset token="search12"></unset>
<set token="search12">*</set>
<unset token="field4"></unset>
<set token="field4">*</set>
<unset token="field5"></unset>
<set token="field5">*</set>
</condition>
</change>
</input>
please help me to fix this.
Thanks!
1 Solution
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ITWhisperer

SplunkTrust
11-11-2024
04:38 AM
Each input has effectively two tokens, one for what the user has chosen on the form, and one for the result of the selection. Try something like this
<change>
<condition value="reset_all_field_search">
<unset token="form.search"></unset>
<set token="form.search">*</set>
<unset token="form.search2"></unset>
<set token="form.search2">*</set>
<unset token="form.search12"></unset>
<set token="form.search12">*</set>
<unset token="form.field4"></unset>
<set token="form.field4">*</set>
<unset token="form.field5"></unset>
<set token="form.field5">*</set>
</condition>
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ITWhisperer

SplunkTrust
11-11-2024
04:38 AM
Each input has effectively two tokens, one for what the user has chosen on the form, and one for the result of the selection. Try something like this
<change>
<condition value="reset_all_field_search">
<unset token="form.search"></unset>
<set token="form.search">*</set>
<unset token="form.search2"></unset>
<set token="form.search2">*</set>
<unset token="form.search12"></unset>
<set token="form.search12">*</set>
<unset token="form.field4"></unset>
<set token="form.field4">*</set>
<unset token="form.field5"></unset>
<set token="form.field5">*</set>
</condition>
