Dashboards & Visualizations

How do you update the value of a token in an init block?

tonydidato
New Member

Using 6.6.2, I have a form that receives a token via a link from another form. The initial form has a grand total field called Total. When the user clicks on that value, I want the resulting form to translate Total to * so that it can be used in a search. Here's one of the many ways I have tried to accomplish this:

  <init>
    <eval token="form.Region">replace($form.Region$,"Total","*")</eval>
  </init>

No matter how I format the eval statement (like, match, etc), it doesn't execute. I have even tried placing the eval statement in the initial form after the drilldown and before the link, and I still can't modify the token value.

Tags (2)
0 Karma

whrg
Motivator

This is much trickier than I thought.
Apparently it is not working to use form tokens in the init section.

I got it working by putting the eval token section in the search of the drilldown dashboard:

<panel>
  <table>
    <title>...</title>
    <search>
      <query>...$form.Region$...</query>
      <progress>
        <eval token="form.Region">replace($form.Region$,"Total","*")</eval>
      </progress>
    </search>

Alternatively, which might be the better solution: Use a done section in the initial search to set a token which you use to populate the drilldown:

<panel>
  <table>
    <search>
      <query>...</query>
      <done>
        <eval token="Region">replace($click.value$,"Total","*")</eval>
      </done>
    </search>
    <option name="count">10</option>
    <drilldown>
      <link target="_blank">...form.Region=$Region$</link>
    </drilldown>
0 Karma

whrg
Motivator

Hi! Could you post the initial form?

0 Karma

tonydidato
New Member

This is the drill down section from the initial form:

       <drilldown>
          <link target="_blank">/app/coo/by_bu?form.Region=$click.value$&amp;form.BU=$bu_dropdown$&amp;form.VM_DXC=$VM_DXC$</link>
        </drilldown>
0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...