How can I map unique strings to each value of a variable in order to insert those strings to make panel titles dynamic?

Hello. I have a variable let’s say it is adminName. I am querying a prometheus datasource in order to obtain 5 values for this adminName variable.

What I want to do now is to make the title of panels dynamic by mapping a special string to each variable value, and then insert that unique string into the title depending on what variable value was selected as a global filter.

For example, maybe adminName has 5 values returned: bob, steve, charlie, allison, tod

if ‘bob’ is selected as a global filter, then I want to display in a panel title a unique string welcoming ‘bob’:
“Hey Bob, here is your unique title just for you, please don’t break the system again”

but if ‘steve’ is selected, then I want the string to change and display in the panel title whatever I defined the mapping to be for Steve:
“Hey Steve, you owe me a donut”

Is there anyway to do this?

Grafana version: v.8.2.7.

Hi @giuseppebarretta,

Welcome to the :grafana: community support forums !!

We are excited that you joined our OSS community. Please read about some of the FAQs in the community :slight_smile:

I think what you are looking for is described in this post.

I hope this helps.

Also, you can use the Global variable i.e. user so that the user can see their name and you can also put org variable so they can view their organization.