Variable with more than one key value pair in repeated panel

  • What Grafana version and what operating system are you using?
    Grafana Cloud (steady)

  • What are you trying to achieve?
    I want to have a repeating panel for a variable I created. The variable v1 postgresql query right now looks like this.

SELECT id AS __value, name AS __text FROM my_table

This works fine, but my_table also has a description column, that I would like to use for the description field inside of the repeating panel. I.e. I want to get 3 different values from my variable.

  • How are you trying to achieve it?
    I followed several approaches that did not work for me.
    I tried loading three columns in my variable query and try to select them as I do with __value and __text
    I tried creating an additional variable v2 which used the following query
    SELECT id AS __value, description AS __text WHERE id = ${v1:value}

  • What happened?
    The first attempt I could not get to work, the second one always showed the first description for all repeated (v1) panels

  • What did you expect to happen?
    I want to see the matching description with my repeated panels.

what are you using the name AS __text field for?

Basically my table contains an id, a name and a description

I use __text for the name already. The id is my primary Key on the table, but as I said I also want to be able to access the description in my repeating panel to use it as a tooltip. I want the name AS __text to have the actual names shown in the dropdown menu and not the values or descriptions.

1 Like

:man_facepalming: of course :laughing: