# Chained Variables with MongoDB

**URL:** <https://community.grafana.com/t/chained-variables-with-mongodb/100037>\
**Category:** Dashboards\
**Tags:** mongodb\
**Created:** [July 28, 2023, 10:15pm UTC](https://community.grafana.com/t/chained-variables-with-mongodb/100037 "2023-07-28T22:15:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhattacharya](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@abhattacharya](https://community.grafana.com/u/abhattacharya)\
**Post date:** [July 28, 2023, 10:15pm UTC](https://community.grafana.com/t/chained-variables-with-mongodb/100037/1 "2023-07-28T22:15:51Z")

</div>

Grafana Cloud (latest)  
MongoDB plugin v.1.9.0 (latest)

Hi all,  
I’m trying to replicate the functionality shown in the Grafana documentation here: [Chained Variables](https://grafana.com/docs/grafana/latest/dashboards/variables/add-template-variables/#chained-variables)

In the [Graphite Templated Nested](https://play.grafana.org/d/000000056/graphite-templated-nested?orgId=1&var-app=country&var-server=All&var-interval=1h) example, they have a dashboard set up so that using chained variables, they have 4 visualizations on the bottom row, of which it seems the latter 3 are automatically generated. This assumption comes from the fact that I am unable to edit them. When the server variable is set to ‘All’, all 4 visualizations appear, with their title dynamically set to $server.

In my case, I similarly have 3 query variables, of which the 2nd is chained to the 1st. I have tried my best to replicate the configuration that is shown in the example, but when I select ‘All’ for the chained variable, I get an error that says ‘Unable to find [name of my x axis field]’. What I’d like to happen is, just as it does in the example dashboard, if I select ‘All’, n different visualizations will appear, all with the correct dynamically set title (where n is the number of values the query for that variable returns).

I can provide the MongoDB queries if need be, but I’m unsure if the problem is on my end or on the MongoDB plugin end.

Thank you for your time!
