# Text before msg.payload

**URL:** <https://discourse.nodered.org/t/text-before-msg-payload/64180>\
**Category:** General\
**Created:** [20 June 2022 18:00 UTC](https://discourse.nodered.org/t/text-before-msg-payload/64180 "2022-06-20T18:00:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![trocalos](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trocalos/32/64540_2.png) [@trocalos](https://discourse.nodered.org/u/trocalos)\
**Post date:** [20 June 2022 18:00 UTC](https://discourse.nodered.org/t/text-before-msg-payload/64180/1 "2022-06-20T18:00:05Z")

</div>

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

I need to put the word "temperature" before the number, as it appears on the right and below

How can I do it?  
Thank you

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [20 June 2022 18:09 UTC](https://discourse.nodered.org/t/text-before-msg-payload/64180/2 "2022-06-20T18:09:41Z")

</div>

The simple way is `msg.payload = "temperature :" + Number(msg.payload)` however, if this is for display on a dashboard or sending to MQTT/HTTP etc, then it is not the recommended solution.

---

<div class="post-metadata">

**Author:** ![trocalos](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trocalos/32/64540_2.png) [@trocalos](https://discourse.nodered.org/u/trocalos)\
**Post date:** [20 June 2022 21:27 UTC](https://discourse.nodered.org/t/text-before-msg-payload/64180/3 "2022-06-20T21:27:05Z")

</div>

Sorry, I have explained myself wrong.  
I am trying to pass a data collected by Blynk to Thingspeak.  
Doing tests I see that if I inject a numerical value with a temperature topic, that value is stored in thingspeak.

I see that the way it is stored correctly is with the statement  
Temperatura : msg.payload : number

Here Temperature is the topic or field of Thingspeak.

So I need to be able to make that appear, or so I think...

Thank you

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/5/450f184399a6950cdb5663c5d8e5f256ad13d188.png)

---

<div class="post-metadata">

**Author:** ![trocalos](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trocalos/32/64540_2.png) [@trocalos](https://discourse.nodered.org/u/trocalos)\
**Post date:** [20 June 2022 21:30 UTC](https://discourse.nodered.org/t/text-before-msg-payload/64180/4 "2022-06-20T21:30:52Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/4/5405a93e774923f1e197f042c269eaaaa473d269.png)

With this solution I was able to introduce the test value in thingspeak, but I don't know how to do it with the function and the Blynk node.

Thank you

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [20 June 2022 21:43 UTC](https://discourse.nodered.org/t/text-before-msg-payload/64180/5 "2022-06-20T21:43:45Z")

</div>

I have no experience with the Blynk node but at a guess...

Put a change node **before** the Blynk node & set `msg.topic` to "temperature"

Or in the function node

```auto
msg.topic = "temperature"
return msg

```

---

<div class="post-metadata">

**Author:** ![trocalos](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trocalos/32/64540_2.png) [@trocalos](https://discourse.nodered.org/u/trocalos)\
**Post date:** [20 June 2022 21:46 UTC](https://discourse.nodered.org/t/text-before-msg-payload/64180/6 "2022-06-20T21:46:31Z")

</div>

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

Thank you, I have solved it with this solution.

I need to understand and know how to write in this language. Do you recommend any course or tutorial?

Thank you

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [21 June 2022 04:21 UTC](https://discourse.nodered.org/t/text-before-msg-payload/64180/7 "2022-06-21T04:21:34Z")

</div>

This online resource covers many languages including **JavaScript**. It also includes "Test yourself with exercises" sections, so you can try out pieces of code as you read through the material.

> **[JavaScript Tutorial](https://www.w3schools.com/js/default.asp)**
>
> W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

---

<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:** [20 August 2022 04:21 UTC](https://discourse.nodered.org/t/text-before-msg-payload/64180/8 "2022-08-20T04:21:38Z")

</div>

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