Custom dashboard variables that depend on the values of other custom dashboard variables?

I’m very new to Graphana, and I’m trying to make a custom variable – $rds – whose value depends on the values of other custom variables – $build and $environment – but in a somewhat complex way that I haven’t been able to figure out how to apply in Graphana.

When $environment == “test”, I want $rds to be “web-$environment”, but when $environment == “prod”, I want $rds to be “$build-$environment”. We only have one test database, but we have different prod DBs for our two different builds.

I’ve currently solved this by just setting $rds as a custom variable with three values, web-test, sites-prod, divisions-prod, but it would be much better if my users didn’t have to manually fiddle with $rds, since its value always depends on the other variables (which they will be setting themselves).

I’m using a self-hosted version of Graphana v8.5.15 (be4228db5a).

welcome to forum @coredumperror

you could accomplish the concatenation if you used infinity plugin.

__text is what user sees in the ui, _value is what the actual value is

Then rds would look like this

final result should look like this.

rds

Even better is if you have this in a database.