# How to get a payload value of a message with a specific topic to show in label of a chart node

**URL:** <https://discourse.nodered.org/t/how-to-get-a-payload-value-of-a-message-with-a-specific-topic-to-show-in-label-of-a-chart-node/93035>\
**Category:** Dashboard\
**Tags:** chart\
**Created:** [10 November 2024 17:45 UTC](https://discourse.nodered.org/t/how-to-get-a-payload-value-of-a-message-with-a-specific-topic-to-show-in-label-of-a-chart-node/93035 "2024-11-10T17:45:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nosered1966](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nosered1966/32/52859_2.png) [@nosered1966](https://discourse.nodered.org/u/nosered1966)\
**Post date:** [10 November 2024 17:45 UTC](https://discourse.nodered.org/t/how-to-get-a-payload-value-of-a-message-with-a-specific-topic-to-show-in-label-of-a-chart-node/93035/1 "2024-11-10T17:45:05Z")

</div>

Hi,  
I know that I can use

```auto
<font color=#1F51FF size="4">{{msg.payload}}</font>

```

to display the value of "msg.payload" as text on the dashboard.

But how can I extract the payload value from a specific message (having a specific topic) to use as text for a chart node, which has more than one wire / more than one messages as input?

Thank you and kind regards  
Thomas

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [10 November 2024 18:08 UTC](https://discourse.nodered.org/t/how-to-get-a-payload-value-of-a-message-with-a-specific-topic-to-show-in-label-of-a-chart-node/93035/2 "2024-11-10T18:08:27Z")

</div>

> [@nosered1966](#):
>
> payload ... to use as text for a chart node,

To use as text where in the chart node?

You can dynamically style the chart label  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/3/a3034d11ab49cd808c8df6033f54f4b914522c9b.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/d/3d26b1d841937548dedb28a49d090392b0e6150d.png)

Or you could put a text node above or below the chart.

---

<div class="post-metadata">

**Author:** ![nosered1966](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nosered1966/32/52859_2.png) [@nosered1966](https://discourse.nodered.org/u/nosered1966)\
**Post date:** [10 November 2024 18:22 UTC](https://discourse.nodered.org/t/how-to-get-a-payload-value-of-a-message-with-a-specific-topic-to-show-in-label-of-a-chart-node/93035/3 "2024-11-10T18:22:23Z")

</div>

@jbudd Thank you for quick response!  
But for dynamically style the chart label I need an additional specific message. I can not directly use the payload of the message (related to you example) you use to draw the red line?

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [10 November 2024 18:28 UTC](https://discourse.nodered.org/t/how-to-get-a-payload-value-of-a-message-with-a-specific-topic-to-show-in-label-of-a-chart-node/93035/4 "2024-11-10T18:28:57Z")

</div>

I can't really imagine the scenario where you would use one of several msg.payloads feeding into a chart node to set the label.

However, I assume you could achieve it something like this  
If this msg.payload is the one you want to use, set a flow context variable.  
Run all inputs to the chart node through a change node which sets msg.label to that context variable.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/8/38b2e37987928cf613d26006a030c53df34f8096.png)

---

<div class="post-metadata">

**Author:** ![nosered1966](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nosered1966/32/52859_2.png) [@nosered1966](https://discourse.nodered.org/u/nosered1966)\
**Post date:** [10 November 2024 18:48 UTC](https://discourse.nodered.org/t/how-to-get-a-payload-value-of-a-message-with-a-specific-topic-to-show-in-label-of-a-chart-node/93035/5 "2024-11-10T18:48:17Z")

</div>

@jbudd

The scenario is: I have two temperature setpoint values and one actual value shown in one chart node. And I want to see only the text of the actual value in the label of the chart "behind" the name of the chart.  
But I think I can mange it using your last example the next days.  
Thank you very much for help so far!  
😀

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [10 December 2024 18:49 UTC](https://discourse.nodered.org/t/how-to-get-a-payload-value-of-a-message-with-a-specific-topic-to-show-in-label-of-a-chart-node/93035/6 "2024-12-10T18:49:14Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
