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!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...