I have a simple form that has a global search to set up the initial values of a time input. With that global search, I also set a token for a label on my form. I'd like to update that label when a new value is chosen from the time input, but I cannot get it to work.
Here is a full simple example to show what I mean. If I change the time picker, I'd expect the label to be updated to reflect that change.
<form hideFilters="false">
<search id="starttimesearch">
<query>
| makeresults
| eval startHours=relative_time(now(), "@h-36h")
| eval startTimeStr=strftime(startHours, "%B %d, %Y %H:%M")
</query>
<done>
<set token="form.timeRange.earliest">$result.startHours$</set>
<set token="form.timeRange.latest">now</set>
<set token="time_label">Since $result.startTimeStr$</set>
</done>
</search>
<fieldset submitButton="false" autoRun="true">
<input type="time" token="timeRange" searchWhenChanged="true">
<label>Time</label>
<default>
</default>
<change>
<set token="time_change_start">strftime($timeRange.earliest$", "%B %d/%Y %H:%M")</set>
<set token="time_change_end">strftime($timeRange.latest$", "%B %d/%Y %H:%M")</set>
<eval token="time_label">case($timeRange.latest$ == now(), "Since $time_change_start$", 1==1, "From $time_change_start$ to %time_change_end$)</eval>
</change>
</input>
</fieldset>
<row>
<panel>
<html>
The time label is $time_label$
</html>
</panel>
</row>
</form>
... View more