-
What** Grafana version and what operating system are you using?
Grafana v11.0.0 (83b9528bce)
-
What are you trying to achieve?
I would like to create a dashboard with a variable that contains other ones with a template, such as postman enviroments
something like
SERVICE A (selectable in dashboard)
{
Endpoint: AAA (Not selectable but usable in panels)
Database: BBB (Not selectable but usable in panels)
Provider: CCC (Not selectable but usable in panels)
}
SERVICE B (selectable in dashboard)
{
Endpoint: AAA (Not selectable but usable in panels)
Database: BBB (Not selectable but usable in panels)
Provider: CCC (Not selectable but usable in panels)
}
- How are you trying to achieve it?
With dashboard variables i can only create Key value varibles with 1:1 relationships. Also with chained values is not possible to achieve it
Thanks
It can be done by using capabilities of datasource:

Example above was done using InfluxDB datasource (without actual database using, just utilizing power of Flux language).
Variables:
Details of Variable Endpoint (Database and Provider are pretty similar):
import "array"
array.from(rows: [
{Service : "A", Endpoint : "AAA1"},
{Service : "B", Endpoint : "AAA2"}
])
|> filter(fn: (r) => r.Service == "${Service}")
|> keep(columns:["Endpoint"])
3 Likes
Thank you so much for providing such a detailed example.
It’s quite questionable why fake data source query is the only way for defining this type of multi custom variable in dashboard.
Anyway, this solution does the trick perfectly 
it does not have to be fake, you can do it with any data source with real data, including a csv file, or inline csv, mysql, mssql etc
infinity uql csv
Clear, what I meant was that data source are available for all dashboards. If I need a set of variables for only one dashboard, why should I configure it making list of real datasources dirty?
Just use real datasources for that purpose if they have necessary capabilities
1 Like
Like this example: If I configure an influx datasource for that purpose and there’s another dashboard that gets all datasources of type influxdB as variabile, that data source used as group o variables would appear
1 Like
gotcha, makes sense. so what are others recommend is just that a recommendation, one way of doing it, you will have to do your due diligence in the implementation side of things that fits your specific need.
1 Like