Support for variables __text and __value - Redshift plugin

I’ve been migrating our Redshift data source from good old Postgres plugin to Redshift plugin.

I noticed that variables don’t work as expected for the case when we were using __text and _value. I’m wondering if support for this feature might be missing in the Redshift plugin (and would hope for a hint to be able to contribute).

Any help, why this is not working is much appreciated.

  • What Grafana version and what operating system are you using?
    10.2.2

  • What are you trying to achieve?

Use the Redshift plugin and have a query variable similar to

SELECT 'myvalue' AS __value, 'mytext' AS __text

I then want to show the __text to the user, but query data based on the __value.

  • What happened?

The variables text AND value is the first column returned.

  • What did you expect to happen?

${var:text} should be mytext, ${var:value} should be myvalue,


See in the screenshot, which should actually show mytext as value preview:

In comparison, see a custom variable defined as mykey : myvalue

I found this topic here, which describes the same problem, but the “solution” doesn’t work for me.

1 Like

very odd. I am not seeing this in v10.3.1 with sql server

Thanks for checking!
This is limited to the Redshift plugin.

Is this a plugin-specific implementation?

Could be but lets try a few other things. Doc says, the order seems different

Make sure that the query returns values named __text and __value as appropriate in your query syntax. For example, in SQL, you can use a query such as SELECT hostname AS __text, id AS __value FROM MyTable . Queries for other languages will vary depending on syntax

No, unfortunately that doesn’t help. Verified it again.

Ok, what if you use a numerical integer value for __value

Definitely sounds like an issue with the rs datasource

Or use a custom manually carved key, value;

Thanks for continuously helping! My original query is returning integer.

As described in the issue, using text instead of __text and value instead of __value works.

2 Likes