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.3.2411?

Hey Splunky People! We are excited to share the latest updates in Splunk Cloud Platform 9.3.2411. This release ...

Buttercup Games: Further Dashboarding Techniques (Part 6)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...

Technical Workshop Series: Splunk Data Management and SPL2 | Register here!

Hey, Splunk Community! Ready to take your data management skills to the next level? Join us for a 3-part ...