Make a variable represent tuple of values

Hello,

Sorry if the question sounds dumb, but I try to use a single variable in order to represent tuples of values and I don’t know how to achieve this.

For example, each value of the app variable would contain the values of a datasource and of another field (the namespace). ie :

  • dev: ("team-cluster", "dev-namespace"),
  • staging: ("team-cluster", "staging-namespace")
  • prod: ("prod-cluster", "team-namespace")

I have to use just the “parts” of the tuple at several places (set the datasource, forge the queries etc.)

I didn’t find a way to create “maps” between variables, nor to take only a substring of the value for using it in a query.

Thanks !

Hi @err0r500,

Welcome to the :grafana: community support forums !!

So, it seems that you are looking for something like a dependent (chained) variable where one variable is dependent on other.

I found a good example for this which might help you to what you are looking for.

I hope this helps.