Skip to content

Canvas: Button API template variable handling breaks if canvas is inside a repeated dashboard row #82041

@scottxusayhi

Description

@scottxusayhi

What happened?

I defined a dashboard varable ${var} with values 1,2,3, and some rows repeat by ${var}.
Inside each repeated row I hava a canvas button, where I used ${var} as part of the API address, e.g., https://jsonplaceholder.typicode.com/todos/${var}.

Here's the screenshot:

image

When I clicked the button in first row, I expect the API address would be https://jsonplaceholder.typicode.com/todos/1, but grafana resolved it to https://jsonplaceholder.typicode.com/todos/{1,2,3}
The same issue happed to query params and payloads fields.

What did you expect to happen?

If a canvas button is within a row that is repeated using ${var}, it will accurately substitute the template variable ${var} with the corresponding value for that row.

Did this work before?

No

How do we reproduce it?

  1. create a new dashboard
  2. define a new variable $var, with value 1,2,3
  3. create a row, repeated by $var, now we have 3 rows
  4. inside the row, create a new canvas button
  5. configure the API address of the button to https://jsonplaceholder.typicode.com/todos/${var}
  6. back to dashboard main view, now we have 3 buttons
  7. click any of the 3 button, observe the API address in browser console

Is the bug inside a dashboard panel?

No response

Environment (with versions)?

Grafana: v10.3
OS: macOS 13.6
Browser: Chrome 121.0.6167.139

Grafana platform?

None

Datasource(s)?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions