Hi,
My requirement is to check all the checkboxes based on the results obtained from the query.
Example: When my query runs it gives the below results of sourcetype. They are displayed as checkbox options. Only first sourcetype "HR" is checked and others are unchecked. I want my query all results to be checked which i am failing to do so.
sourcetype
HR
LP
MN
I am using the below code
<input type="checkbox" id="check1" token="environment" searchWhenChanged="true">
<label>Environments</label>
<search>
<query>index = main sourcetype = landscape earliest=-48h |dedup sourcetype
| table sourcetype</query>
</search>
<change>
<condition value="HR">
<set token="HR">HR</set>
</condition>
<condition>
<unset token="HR"></unset>
</condition>
</change>
<default>*</default>
<initialValue>*</initialValue>
<delimiter> </delimiter>
<fieldForLabel>sourcetype</fieldForLabel>
<fieldForValue>sourcetype</fieldForValue>
</input>
any suggestions on how i can do this ?
Checkboxes are in the <input> element because they are inputs to a query. They are not outputs.
You can set tokens based on the results of a query, but that will not affect any inputs associated with those tokens.