Customising alert message

I’m trying to customise my alert template message based on the values returned by my query. However, the problems right now:-

  1. I’m unable to fetch the column (type text) that I want to use in the message template
  2. I’m unable to use the column value that I want to embed into my message template

Initially I was using Legacy Alerting System, but that doesn’t achieve what I want. Upgraded to Unified Alerting System also doesn’t resolve my issue.

This is my current query

welcome to the :grafana: community @syahnurnizam!

You might find this thread interesting, it’s for slack notifications, but I wrote some instructions there about how to get the values from your query to add into your message template.

The second issue (the errors shown in your screenshot) make me think that the query result isn’t a number that the condition in your expression query (B) can use to evaluate.