Dashboards & Visualizations

What is the real difference between a $token$ and $form.token$?

vshakur
Path Finder

When I set up a token named "token" as part of an input component or a condition tag in my dashboard, I can refer to its value or change it either with $token$ or $form.token$.
Sometimes only $token$ works and sometimes $form.token$ so when I want to reset this token I reset both $token$ and $form.token$.
This is really confusing, time wasting and a bad habit. Therefore, I'd like to know when should I use $token$ and when $form.token$?

Thanks,
Sam

1 Solution

pramit46
Contributor

@vshakur

If your token has a physical existence then you should use form.tokenname otherwise you can just use tokenname.

When you use form, that becomes part of the URL in the address bar, hence can be useful for embedding the dashboard with another external application (e.g.: passing token values as preset).

the way I used to understand is: a token without the keyword 'form' is just a volatile variable. On the other hand, when you set the values of any physical input like: textbox or checkbox or dropdown etc. then you use form.token

View solution in original post

pramit46
Contributor

@vshakur

If your token has a physical existence then you should use form.tokenname otherwise you can just use tokenname.

When you use form, that becomes part of the URL in the address bar, hence can be useful for embedding the dashboard with another external application (e.g.: passing token values as preset).

the way I used to understand is: a token without the keyword 'form' is just a volatile variable. On the other hand, when you set the values of any physical input like: textbox or checkbox or dropdown etc. then you use form.token

pramit46
Contributor

@vshakur,

if you think my explanation clarifies your doubt then please accept it as answer, or let me know if you still have any questions.

0 Karma

kmaron
Motivator

You only need $form.token$ when linking outside of your dashboard (like a drilldown link) or between dashboards. Any token that is created and used within the same dashboard should be just $token$

Get Updates on the Splunk Community!

Registration for Splunk University is Now Open!

Are you ready for an adventure in learning?   Brace yourselves because Splunk University is back, and it's ...

Splunkbase | Splunk Dashboard Examples App for SimpleXML End of Life

The Splunk Dashboard Examples App for SimpleXML will reach end of support on Dec 19, 2024, after which no new ...

Understanding Generative AI Techniques and Their Application in Cybersecurity

Watch On-Demand Artificial intelligence is the talk of the town nowadays, with industries of all kinds ...