Template variable with single quote(') being represented as double quote ('') in qurey section

I have a template variable country_name, whose value is “Cote D’Ivoire”. But when I use that template variable inside a query, generated query has the the country_name as “Cote D’'Ivoire”

Note : Same variable used in Panel title bar and the result is as expected.

Grafana Version : Grafana v6.5.2 (742d165)
Database connection : mysql
Query used : select “${country_name}” as country_name

Looks like this is done to escape the single quote character (’) for the query forming. But in this case when I enclose it with double quotes (") then the srtring matching is failing

What do the settings look like for the $country_name variable? Is it a MySQL query or a “custom” variable? Multi or single value?

You could try ${country_name:raw} so that Grafana does not try to do any interpolation or escaping.

5 Likes

Thanks @daniellee, $country_name was a query with single value.
Using :raw with the variable worked :slight_smile:

1 Like