Dashboards & Visualizations

Can Multiselect Input have a dynamic default value?

shelbyladallen
Engager

I'd hope something like the following would work:

<input type="multiselect" searchWhenChanged="true" token="FY">
  <label>Fiscal Year</label>
  <search>
    <query>| savedsearch filter_fiscal_year</query>
   <condition match=" 1 == 1 ">
      <set token="foo">"2014"</set>
   </condition>
  </search>
  <default>$foo$</default>
  <fieldForLabel>FISCAL_YEAR</fieldForLabel>
  <fieldForValue>FISCAL_YEAR</fieldForValue>
  <prefix>(</prefix>
  <suffix>)</suffix>
</input>

Basically I'd like to populate $foo$ with the current fiscal year, while still allowing the user to select multiple fiscal years.
So far my errors suggest either that the token isn't being created properly OR that I can't use a token within the tag.

Thanks.

Tags (1)

Oti47
Path Finder

Same Problem,
I try to set the $foo$ token during a search at the same dashboard.

Option "Select first coice" doesn't work at multiselect.

URL link doesn't work for me.

Any other ideas?

Thanks

0 Karma

cb_usps
Explorer

I've tried using 'set token=' in each possible spot in the XML hierarchy and have come to the conclusion that it simply does not work, I have not witnessed a new token get created.
Also, tokens do not work in the 'default' field. As far as I can tell the reason is that the 'default' value becomes part of the URL for the form, and tokens are not parsed yet.
So, what I do to populate a default value is build it into the URL for the form. In your case it would be something like:
http://your_search_head_host:8000/en-US/app/your_app_name/your_form_name?form.FY=2014

and remove the $foo$ stuff.

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...