Plugins
Data sourceCommunity
Finnhub logo

Finnhub

clarity89

Get plugin

Template variables

Use template variables to create dynamic, reusable dashboards that let you change query parameters without editing individual panels. For general information about template variables, refer to Templates and variables (opens in new tab).

Before you begin

Supported variable types

The Finnhub data source supports the following variable types:

Variable typeSupported
QueryYes
CustomYes
Data sourceYes
Ad hoc filtersNo

Use variables in queries

Variables work in the Symbol, Search, Exchange and Category fields, written as $variable or ${variable}.

  • The plugin replaces each of those fields with one string, so use single-value variables.
  • The plugin uppercases Symbol after it replaces the variable.
  • Resolution, Metric and Free Query Text don't interpolate variables.

For example, add a text box variable named symbol with the value AAPL, then set Symbol in a panel to $symbol. The panel queries the symbol the variable holds.

Annotation queries interpolate the same four fields as panel queries do.

Query variables

A query variable fills its drop-down by running a query against Finnhub, so its options stay current with your data. Use one to let viewers pick a value, such as a ticker, and update every panel that uses it.

To create a query variable:

  1. Navigate to Dashboard settings > Variables.
  2. Click Add variable.
  3. Select Query as the variable type.
  4. Select the Finnhub data source.
  5. Choose a Data type.
  6. Fill the fields the type shows, such as Symbol or Search.

The variable editor is the same query editor as a panel uses, with the same fields and the same data types.

The first string field of the query result becomes both the option value and the option text. Add a Symbol lookup or Peers query to list tickers, because both types return a string field.

For example, to list the peers of a company:

  1. Add a text box variable named search with a company name as its value.
  2. Add a query variable named company, set Data type to Symbol lookup and set Search to $search. The options are the matching tickers.
  3. Add a query variable named peer, set Data type to Peers and set Symbol to $company. The options are the peer tickers.
  4. Use $peer in the Symbol field of a panel query.

Grafana stores the peer variable query as this target:

{
  "refId": "PeerVar",
  "type": "peers",
  "symbol": "$company",
  "search": "",
  "resolution": "1",
  "metric": "price",
  "exchange": "US",
  "category": "general"
}

Trades opens a stream and returns no response body to shape, so you can't use it as a variable source.

Insights

  • Adoption

    Running on 738 active Grafana instances.

  • Activity

    Last updated 6 Nov 2026.

    3 releases in the past year.

  • Queries

    4,451 total queries served across all Grafana Cloud instances.

Version
1.1.0
Dependencies
  • Grafana >=12.4.0
Developer
clarity89

Grafana Cloud

Connect any plugin in Grafana Cloud.

  • 150+ data source integrations
  • Grafana Assistant - AI that correlates your data, builds queries, and answers questions
  • 10k Prometheus metrics + 50 GB logs, traces, and profiles on the free tier
  • ...and more
Create free account