# How to use variables to filter data from CSV?

**URL:** <https://community.grafana.com/t/how-to-use-variables-to-filter-data-from-csv/103917>\
**Category:** Dashboards\
**Tags:** dashboard-variables, csv\
**Created:** [September 20, 2023, 3:01am UTC](https://community.grafana.com/t/how-to-use-variables-to-filter-data-from-csv/103917 "2023-09-20T03:01:10Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![cholmanattom](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@cholmanattom](https://community.grafana.com/u/cholmanattom)\
**Post date:** [September 20, 2023, 3:01am UTC](https://community.grafana.com/t/how-to-use-variables-to-filter-data-from-csv/103917/1 "2023-09-20T03:01:10Z")

</div>

I want to use data from my CSV file as data source in Grafana 10  
I know how to use variables to filter data from MySQL query but I don’t know where to filter CSV data with variables. There is no explicit place to put in variables like in MySQL query.

---

<div class="post-metadata">

**Author:** ![manu3453as](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@manu3453as](https://community.grafana.com/u/manu3453as)\
**Post date:** [November 16, 2023, 4:33pm UTC](https://community.grafana.com/t/how-to-use-variables-to-filter-data-from-csv/103917/2 "2023-11-16T16:33:34Z")

</div>

Hello, I would like to know if you managed to solve this problem? I’m trying to make dynamic panels in Grafana from CSV files but I can’t link variables to the panel.

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [November 16, 2023, 5:15pm UTC](https://community.grafana.com/t/how-to-use-variables-to-filter-data-from-csv/103917/3 "2023-11-16T17:15:47Z")

</div>

@manu3453as

It is not clear what you are trying to do? What are make dynamic panels and what do you mean by but I can’t link variables to the panel.

---

<div class="post-metadata">

**Author:** ![manu3453as](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@manu3453as](https://community.grafana.com/u/manu3453as)\
**Post date:** [November 16, 2023, 5:44pm UTC](https://community.grafana.com/t/how-to-use-variables-to-filter-data-from-csv/103917/4 "2023-11-16T17:44:39Z")

</div>

Thank you for your response. I will try to make myself understood. I already managed to create the variables, as shown here. But in the part of the query, where the variable is associated, it does not allow me or I do not know how to associate variables when I have csv format.

 ![IMG_20231116_121827](https://us1.discourse-cdn.com/grafana/original/3X/d/f/dfc9fb6602455fcb4547f310be834532b685f6da.jpeg)

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [November 16, 2023, 6:39pm UTC](https://community.grafana.com/t/how-to-use-variables-to-filter-data-from-csv/103917/5 "2023-11-16T18:39:38Z")

</div>

not sure you can with that plugin. But here it is with infinity plugin

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/5/3/53820ae901f92b7ac834434955fdcdc115ca1be8.png)

---

<div class="post-metadata">

**Author:** ![shrivastavapunit](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@shrivastavapunit](https://community.grafana.com/u/shrivastavapunit)\
**Post date:** [July 2, 2024, 5:31pm UTC](https://community.grafana.com/t/how-to-use-variables-to-filter-data-from-csv/103917/6 "2024-07-02T17:31:33Z")

</div>

Below documentation can be used to achive multi input

> **[Variable syntax | Grafana documentation](https://grafana.com/docs/grafana/latest/dashboards/variables/variable-syntax/)**
>
> Learn about different types of variable syntax

I have used ‘${servers:csv}’ to achive manual multi inputs where I am passing multiple inputs on the fly, this is useful when one can not add these values in a predefined dropdown values

---

<div class="post-metadata">

**Author:** ![punithrajbb](https://avatars.discourse-cdn.com/v4/letter/p/4bbf92/32.png) [@punithrajbb](https://community.grafana.com/u/punithrajbb)\
**Post date:** [August 5, 2024, 9:00am UTC](https://community.grafana.com/t/how-to-use-variables-to-filter-data-from-csv/103917/7 "2024-08-05T09:00:03Z")

</div>

Hello Manu, can you give a step to add variable to csv data pulled from API.

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [August 5, 2024, 12:41pm UTC](https://community.grafana.com/t/how-to-use-variables-to-filter-data-from-csv/103917/8 "2024-08-05T12:41:59Z")

</div>

are you using infinity plugin?

---

<div class="post-metadata">

**Author:** ![punithrajbb](https://avatars.discourse-cdn.com/v4/letter/p/4bbf92/32.png) [@punithrajbb](https://community.grafana.com/u/punithrajbb)\
**Post date:** [August 5, 2024, 1:00pm UTC](https://community.grafana.com/t/how-to-use-variables-to-filter-data-from-csv/103917/9 "2024-08-05T13:00:24Z")

</div>

Yes using Infinity plugin

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [August 5, 2024, 1:13pm UTC](https://community.grafana.com/t/how-to-use-variables-to-filter-data-from-csv/103917/10 "2024-08-05T13:13:36Z")

</div>

check out uql with parse-csv and filter documentatiom, try it out and post when stuck

[https://grafana.github.io/grafana-infinity-datasource/docs/uql](https://grafana.github.io/grafana-infinity-datasource/docs/uql)

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [August 19, 2024, 2:19pm UTC](https://community.grafana.com/t/how-to-use-variables-to-filter-data-from-csv/103917/13 "2024-08-19T14:19:34Z")

</div>

this wont work for grafana visualization

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [December 30, 2024, 6:00am UTC](https://community.grafana.com/t/how-to-use-variables-to-filter-data-from-csv/103917/16 "2024-12-30T06:00:33Z")

</div>


