# Alert message templates

**URL:** <https://community.grafana.com/t/alert-message-templates/53523>\
**Category:** Alerting\
**Tags:** templating, alerting\
**Created:** [September 20, 2021, 10:15am UTC](https://community.grafana.com/t/alert-message-templates/53523 "2021-09-20T10:15:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbezuidenhout](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/mbezuidenhout/32/18731_2.png) [@mbezuidenhout](https://community.grafana.com/u/mbezuidenhout)\
**Post date:** [September 20, 2021, 10:15am UTC](https://community.grafana.com/t/alert-message-templates/53523/1 "2021-09-20T10:15:02Z")

</div>

- What Grafana version and what operating system are you using?  
8.1.1

- **What** are you trying to achieve?  
Showing the value in the alert message

- **How** are you trying to achieve it?  
Using a template as follows: Water tank distance at {{ .Value }}

- What happened?  
Output is: Water tank distance at [metric=‘mqtt\_consumer’ labels={host=REDACTED, topic=REDACTED} value=23.877]

- What did you **expect** to happen?  
I want the message to read: Water tank distance at 23.877

- Can you copy/paste the configuration(s) that you are having problems with?  
Water tank distance at {{ .Value }}

- Did you receive any errors in the Grafana UI or in related logs? If so, please tell us **exactly** what they were.  
No

- Did you follow any online instructions? If so, what is the URL?  
[Message templating | Grafana documentation](https://grafana.com/docs/grafana/latest/alerting/unified-alerting/message-templating/)  
[Template data | Grafana documentation](https://grafana.com/docs/grafana/latest/alerting/unified-alerting/message-templating/template-data/)

---

<div class="post-metadata">

**Author:** ![carstenl](https://avatars.discourse-cdn.com/v4/letter/c/958977/32.png) [@carstenl](https://community.grafana.com/u/carstenl)\
**Post date:** [September 20, 2021, 11:05am UTC](https://community.grafana.com/t/alert-message-templates/53523/2 "2021-09-20T11:05:44Z")

</div>

Have you tried without .(dot)

Water tank distance at {{ Value }}  
Could also be case sensitive. I see you have value with small v not capital.

/ Carsten

---

<div class="post-metadata">

**Author:** ![mbezuidenhout](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/mbezuidenhout/32/18731_2.png) [@mbezuidenhout](https://community.grafana.com/u/mbezuidenhout)\
**Post date:** [November 11, 2021, 10:12am UTC](https://community.grafana.com/t/alert-message-templates/53523/3 "2021-11-11T10:12:24Z")

</div>

It turns out that I cannot do this with a “Classic Condition” In order for it to work I needed to use a Reduce expression to reduce the sample set to a single value then use a Math expression to give a value of 0 or 1.

I can then use something like {{ $values.B.Value }} in the alert summary

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/grafana/original/2X/e/ef5308cc58c9e5a13187b5012eb99f406928462f.png) [@system](https://community.grafana.com/u/system)\
**Post date:** [September 20, 2022, 10:15am UTC](https://community.grafana.com/t/alert-message-templates/53523/4 "2022-09-20T10:15:26Z")

</div>

Closed on September 20, 2022, 10:15am UTC

This topic was automatically closed after 365 days. New replies are no longer allowed.
