# Infinity Datasource using datasource variable

**URL:** <https://community.grafana.com/t/infinity-datasource-using-datasource-variable/161186>\
**Category:** Grafana\
**Tags:** dashboard-variables, infinity-datasource\
**Created:** [January 20, 2026, 7:17pm UTC](https://community.grafana.com/t/infinity-datasource-using-datasource-variable/161186 "2026-01-20T19:17:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kcwitch](https://avatars.discourse-cdn.com/v4/letter/k/b19c9b/32.png) [@kcwitch](https://community.grafana.com/u/kcwitch)\
**Post date:** [January 20, 2026, 7:17pm UTC](https://community.grafana.com/t/infinity-datasource-using-datasource-variable/161186/1 "2026-01-20T19:17:25Z")

</div>

Hi all

I need some guide in using datasource variables with infinity datasource.

I created 3 datasources with different url endpoints (e.g api-example-dev com/). I already created the variable but need help on how to use them in the url or query (json).

example of the url

[https://api-example-dev.com/products](https://api-example-dev.com/products)

[https://api-example-stage.com/products](https://api-example-stage.com/products)

Goal: to select each env from a dropdown and display the products panels. Thanks for in advance

---

<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:** [January 21, 2026, 5:38pm UTC](https://community.grafana.com/t/infinity-datasource-using-datasource-variable/161186/2 "2026-01-21T17:38:34Z")

</div>

you can configure your environment as follows

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/6/e/6e0763dcf04da946264a3dbc71c831ce37a5d2cc.png)

the \_\_text column is what will be displayed when using `${envs:text}`

the \_\_value column is what will be displayed when using `${envs:value}`

Then you use the variable as follows

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/4/e/4ed1f14047c997d849a2c0563547bc171c5b60ba.png)

---

<div class="post-metadata">

**Author:** ![kcwitch](https://avatars.discourse-cdn.com/v4/letter/k/b19c9b/32.png) [@kcwitch](https://community.grafana.com/u/kcwitch)\
**Post date:** [January 23, 2026, 7:49pm UTC](https://community.grafana.com/t/infinity-datasource-using-datasource-variable/161186/3 "2026-01-23T19:49:58Z")

</div>

thanks for the respone @yosiasz  
regarding the envs/value? Do I have to define that as a variable? If yea, which variable type?  
thanks

---

<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:** [January 26, 2026, 6:12pm UTC](https://community.grafana.com/t/infinity-datasource-using-datasource-variable/161186/4 "2026-01-26T18:12:23Z")

</div>

you can do it many different ways as long as the data looks like I laid out

sql query,static data, csv data (as show above) etc @kcwitch

---

<div class="post-metadata">

**Author:** ![kcwitch](https://avatars.discourse-cdn.com/v4/letter/k/b19c9b/32.png) [@kcwitch](https://community.grafana.com/u/kcwitch)\
**Post date:** [January 28, 2026, 8:43am UTC](https://community.grafana.com/t/infinity-datasource-using-datasource-variable/161186/5 "2026-01-28T08:43:13Z")

</div>

thanks @yosiasz  
I actually got it by adding a new ds connection and then created a datasource variable. thanks for the support

---

<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:** [January 28, 2026, 12:34pm UTC](https://community.grafana.com/t/infinity-datasource-using-datasource-variable/161186/6 "2026-01-28T12:34:51Z")

</div>

Closed on January 28, 2026, 12:34pm UTC


