---
title: "Chain variables together | Grafana Labs"
description: "Learn how to create dependent variable relationships and cascading filters."
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# Chain variables together

Chained variables create dependent relationships where the options available in one variable depend on the selections made in another. This pattern enables cascading filters that help users drill down through hierarchical data structures.

Cascading filter patterns are common in multi-tier filtering scenarios such as region &gt; cluster &gt; namespace &gt; pod. Each level narrows the available options based on the previous selection, creating an intuitive navigation experience through your infrastructure or data hierarchy.

To create chained variables, complete the following steps:

01. In the sidebar on the right side of the dashboard, click the **Dashboard options** icon.
02. In the edit pane that opens, click **Settings**.
03. On the **Settings** page, go to the **Variables** tab.
04. Create your first-level variable or parent variable.
    
    For example, create a `region` variable with query `label_values(region)`.
05. Click **Save** in top-right corner, enter an optional description of the changes, and **Save** again.
06. Click **Back to list** at the bottom of the page.
07. Click **Add variable** to create a second variable that depends on the first.
08. Name your dependent or child variable.
    
    For example, `cluster`.
09. In the **Query** field, reference the parent variable to filter results.
    
    For example, use `label_values(up{region="$region"}, cluster)`.
10. Save the variable and then click **Back to dashboard**.
11. On the dashboard, test the cascading behavior by changing the parent variable selection.
    
    The dependent variable options update automatically based on the parent selection.
12. Repeat the process to create additional levels of chained variables.
    
    For example, create a `namespace` variable that depends on `cluster`.
13. When you’ve finished your chain of variables, click **Save**.
14. (Optional) Enter a description of the changes you’ve made.
15. Click **Save** and **Back to list** at the bottom of the page.

Selecting a value in the parent variable updates the available options in dependent variables, creating a cascading filter experience.

In the next milestone, you learn how to configure variable display options to control how variables appear to your users.
