I have the following dropdown menu:
<fieldset autoRun="true" submitButton="false">
<input type="dropdown" token="select_wday">
<label>Select Day:</label>
<choice value="Mon">Mon</choice>
<choice value="Tue">Tue</choice>
<choice value="Wed">Wed</choice>
<choice value="Thu">Thu</choice>
<choice value="Fri">Fri</choice>
<choice value="Sat">Sat</choice>
<choice value="Sun">Sun</choice>
<default>Fri</default>
</input>
</fieldset>
The default in the drop-down above would be Friday. Is there a way I could control it that if the user visited the dashboard on a Wednesday the would Wednesday as the value in the drop-down menu?
I am thinking something liket the below which I have used to populate a checkbox, but I have not used it to set the default.
<populatingSearch fieldForValue="userLabel" fieldForLabel="userLabel" earliest="-24h" latest="now">
<![CDATA[
<search goes here that would give the current day of the week>
]]>
</populatingSearch>
Hi @HattrickNZ
give this a try
<dashboard>
<label>check123</label>
<search>
<query>|makeresults | eval Date=strftime(_time," %a") | table Date</query>
<earliest>-15m</earliest>
<latest>now</latest>
<finalized >
<condition match=" 'job.resultCount' != 0">
<set token="Date">$result.Date$</set>
</condition>
</finalized >
</search>
<fieldset autoRun="true" submitButton="false">
<input type="dropdown" token="select_wday">
<label>Select Day:</label>
<choice value="Mon">Mon</choice>
<choice value="Tue">Tue</choice>
<choice value="Wed">Wed</choice>
<choice value="Thu">Thu</choice>
<choice value="Fri">Fri</choice>
<choice value="Sat">Sat</choice>
<choice value="Sun">Sun</choice>
<default>$Date$</default>
</input>
</fieldset>
</dashboard>
Thanks
Hi @HattrickNZ
give this a try
<dashboard>
<label>check123</label>
<search>
<query>|makeresults | eval Date=strftime(_time," %a") | table Date</query>
<earliest>-15m</earliest>
<latest>now</latest>
<finalized >
<condition match=" 'job.resultCount' != 0">
<set token="Date">$result.Date$</set>
</condition>
</finalized >
</search>
<fieldset autoRun="true" submitButton="false">
<input type="dropdown" token="select_wday">
<label>Select Day:</label>
<choice value="Mon">Mon</choice>
<choice value="Tue">Tue</choice>
<choice value="Wed">Wed</choice>
<choice value="Thu">Thu</choice>
<choice value="Fri">Fri</choice>
<choice value="Sat">Sat</choice>
<choice value="Sun">Sun</choice>
<default>$Date$</default>
</input>
</fieldset>
</dashboard>
Thanks
that's kind of it.
but it is putting a space
(%20) before the Fri
for example the url goes to this
/check123?form.select_wday=%20Fri
and if I wanna pass the select_wday
to other panels further down it puts the space in front of Fri.
Any way to not add the space?
tks
extra space was added in | eval Date=strftime(_time," %a")
try taking out the space as this ---- | eval Date=strftime(_time,"%a")
Thanks
tks missed that!
|makeresults | eval Date=strftime(_time," %a") | table Date
This will give you the complete list with first option as Today's
|makeresults | eval Date=strftime(_time," %a") | table Date | append [|gentimes start=10/28/07 | head 7 | eval Date=strftime(endtime," %a") | table Date] | dedup Date
tks, my question was more around the xml part. how should the xml code look?