# Variable indexing not working anymore

**URL:** <https://community.grafana.com/t/variable-indexing-not-working-anymore/139833>\
**Category:** Dashboards\
**Created:** [January 8, 2025, 7:25pm UTC](https://community.grafana.com/t/variable-indexing-not-working-anymore/139833 "2025-01-08T19:25:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thermodynamicbeta](https://avatars.discourse-cdn.com/v4/letter/t/f08c70/32.png) [@thermodynamicbeta](https://community.grafana.com/u/thermodynamicbeta)\
**Post date:** [January 8, 2025, 7:25pm UTC](https://community.grafana.com/t/variable-indexing-not-working-anymore/139833/1 "2025-01-08T19:25:21Z")

</div>

I just upgraded to Grafana v11.3

Before, I could index list variables using

${variable\_name.0}

That seems to return all values now, and the variable syntax doesn’t seem to mention anything. Why?

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

---

<div class="post-metadata">

**Author:** ![ebabeshko](https://avatars.discourse-cdn.com/v4/letter/e/9d8465/32.png) [@ebabeshko](https://community.grafana.com/u/ebabeshko)\
**Post date:** [January 8, 2025, 8:01pm UTC](https://community.grafana.com/t/variable-indexing-not-working-anymore/139833/2 "2025-01-08T20:01:22Z")

</div>

> [@thermodynamicbeta](#):
>
> That seems to return all values now, and the variable syntax doesn’t seem to mention anything. Why?

Looks like a bug

> <https://github.com/grafana/grafana/issues/96336>
>
> \### What happened?
> 
> Accessing an element from a variable of type array yields th…e entire variable.
> 
> \- \`${myvar}\` --\> yields the entire array
> \- \`${myvar.0}\` --\> yields the entire array
> \- \`${myvar.1}\` --\> yields the entire array
> 
> All yield the same value. It is not possible to select an element from the array.
> 
> \### What did you expect to happen?
> 
> \- \`${myvar}\` --\> yields the entire array
> \- \`${myvar.0}\` --\> yields the first element of the array
> \- \`${myvar.1}\` --\> yields the second element of the array
> 
> \### Did this work before?
> 
> It worked in version 11.2.2.
> 
> It is broken in version 11.3.0.
> 
> \### How do we reproduce it?
> 
> 
> 1. Create an Infinity Datasource with No Auth
> 2. Import this dashboard
> 
> \`dashboard.json\`
> \`\`\`json
> {
> "annotations": {
> "list": \[
> {
> "builtIn": 1,
> "datasource": {
> "type": "grafana",
> "uid": "-- Grafana --"
> },
> "enable": true,
> "hide": true,
> "iconColor": "rgba(0, 211, 255, 1)",
> "name": "Annotations & Alerts",
> "type": "dashboard"
> }
> \]
> },
> "editable": true,
> "fiscalYearStartMonth": 0,
> "graphTooltip": 0,
> "id": 43,
> "links": \[\],
> "panels": \[
> {
> "datasource": {
> "name": "${datasource}",
> "type": "yesoreyeram-infinity-datasource",
> "uid": "${datasource}"
> },
> "description": "",
> "fieldConfig": {
> "defaults": {
> "color": {
> "mode": "thresholds"
> },
> "custom": {
> "align": "auto",
> "cellOptions": {
> "type": "auto"
> },
> "inspect": false
> },
> "mappings": \[\],
> "thresholds": {
> "mode": "absolute",
> "steps": \[
> {
> "color": "green",
> "value": null
> },
> {
> "color": "red",
> "value": 80
> }
> \]
> }
> },
> "overrides": \[\]
> },
> "gridPos": {
> "h": 10,
> "w": 24,
> "x": 0,
> "y": 0
> },
> "id": 1,
> "options": {
> "cellHeight": "sm",
> "footer": {
> "countRows": false,
> "fields": "",
> "reducer": \["sum"\],
> "show": false
> },
> "showHeader": true
> },
> "pluginVersion": "11.2.2",
> "targets": \[
> {
> "columns": \[\],
> "datasource": {
> "type": "yesoreyeram-infinity-datasource",
> "uid": "${datasource}"
> },
> "filters": \[\],
> "format": "table",
> "global\_query\_id": "",
> "refId": "A",
> "root\_selector": "",
> "source": "url",
> "type": "json",
> "url": "https://jsonplaceholder.typicode.com/posts/${myvararray.0}",
> "url\_options": {
> "data": "",
> "method": "GET"
> }
> }
> \],
> "type": "table"
> }
> \],
> "schemaVersion": 39,
> "tags": \[\],
> "templating": {
> "list": \[
> {
> "current": {
> "selected": true,
> "text": \["All"\],
> "value": \["$\_\_all"\]
> },
> "datasource": {
> "type": "yesoreyeram-infinity-datasource",
> "uid": "de3tjbvbn2fwgf"
> },
> "definition": "posts- (infinity) json",
> "description": "Selecting one entry works\\nSelecting 2 entries breaks the query",
> "hide": 0,
> "includeAll": true,
> "multi": true,
> "name": "myvararray",
> "options": \[\],
> "query": {
> "infinityQuery": {
> "columns": \[
> {
> "selector": "id",
> "text": "id",
> "type": "string"
> }
> \],
> "filters": \[\],
> "format": "table",
> "parser": "backend",
> "refId": "variable",
> "root\_selector": "",
> "source": "url",
> "type": "json",
> "url": "https://jsonplaceholder.typicode.com/posts",
> "url\_options": {
> "data": "",
> "method": "GET"
> }
> },
> "query": "",
> "queryType": "infinity"
> },
> "refresh": 1,
> "regex": "",
> "skipUrlSync": false,
> "sort": 0,
> "type": "query"
> },
> {
> "current": {
> "selected": true,
> "text": "posts",
> "value": "de3tjbvbn2fwgf"
> },
> "hide": 0,
> "includeAll": false,
> "multi": false,
> "name": "datasource",
> "options": \[\],
> "query": "yesoreyeram-infinity-datasource",
> "queryValue": "",
> "refresh": 1,
> "regex": "",
> "skipUrlSync": false,
> "type": "datasource"
> }
> \]
> },
> "time": {
> "from": "now-6h",
> "to": "now"
> },
> "timepicker": {},
> "timezone": "browser",
> "title": "Debug Dashboard",
> "uid": "de3tjviczek1sc",
> "version": 9,
> "weekStart": ""
> }
> \`\`\`
> 
> 4. In Settings -\> Variables -\> myvararray, select the Infinity Datasource you have created in step 1 to generate a list of IDs
> 5. Go back on the Dashboard main view
> 6. In the \`datasource\` dropdown. select the Infinity Datasource created in step one
> 7. In the \`myvararray\` dropdown, select one element ==\> It works for Grafana 11.2.2 and 11.3.0
> 8. In the \`myvararray\` dropdown, select two elements ==\> It breaks the panel for Grafana 11.3.0 even though we have requested: \`https://jsonplaceholder.typicode.com/posts/${myvararray.0}\` 
> 
> \### Is the bug inside a dashboard panel?
> \_No response\_
> 
> \### Environment (with versions)?
> 
> Grafana: 11.3.0
> OS: Linux
> Browser: Firefox 132.0.1
> 
> 
> \### Grafana platform?
> 
> Kubernetes
> 
> \### Datasource(s)?
> 
> \_No response\_
