Require multiple variable formats to be applied to a query

  • What Grafana version and what operating system are you using?
    OSS Grafana v10.1.2 , Mac OS Ventura 13.4

  • What are you trying to achieve?
    This was regarding setting multiple values for a variable in grafana. We have integrated grafana dashboard with Restful api. As mentioned here https://grafana.com/docs/grafana/latest/dashboards/variables/variable-syntax/, we have added sub_c=${sub_c:csv} to a query path to get comma separated values, but we also need to add encoding for this, something like sub_c=${sub_c:percentencode}. How can I set both the values in grafana ?

  • How are you trying to achieve it?
    I tried a lot of things like sub_c=${sub_c:csv}&sub_c=${sub_c:percentencode}

  • What happened?
    It takes only one value either csv or percentencode

  • What did you expect to happen?
    I need both variable format options.

  • Can you copy/paste the configuration(s) that you are having problems with?
    /api/xyz?sub_c=${sub_c:percentencode}&sub_c=${sub_c:csv}

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    Yes, when I use the above query, its not able to encode the variable with special characters. For text like β€˜Tax & Treat(Tn)’ it gives me following error - β€˜Unknown parameter Treat(Tn) found’

  • Did you follow any online instructions? If so, what is the URL?
    Yes, I refered Variable syntax | Grafana documentation