Mapping custom variable values back to keys in query result

I have a query type multi-value custom variable several key:value pairs. The keys are some human-friendly names and the values (IDs) are used in (Flux) query for filtering. Is there a way to “map” the values (ie. IDs) in the query result back to keys so that in panels user can see names instead of raw IDs?

For now I have a workaround on the InfluxDB side, but it complicates the queries and requires other extra work, so I’m looking for a better solution.

I could find a transformation that could be used. And chained queries do not seem to be supported.

Thank you.

Hi ,
Even I had the same issue but I figured It out. Please try below syntax -
|> filter(fn: (r) => r[“tagId”] == “${tag_id:value}”)
Using it like this gives you access to use key or value of the particular custom variable mapping in flux query.

Hope this helps.