# How to send an integer value with an topic to thingspeak?

**URL:** https://discourse.nodered.org/t/how-to-send-an-integer-value-with-an-topic-to-thingspeak/88754
**Category:** General
**Tags:** function-node
**Created:** [17 June 2024 10:16 UTC](https://discourse.nodered.org/t/how-to-send-an-integer-value-with-an-topic-to-thingspeak/88754 "2024-06-17T10:16:17Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![ledi](https://avatars.discourse-cdn.com/v4/letter/l/ea666f/32.png) [@ledi](https://discourse.nodered.org/u/ledi)
#### Post date: [17 June 2024 10:16 UTC](https://discourse.nodered.org/t/how-to-send-an-integer-value-with-an-topic-to-thingspeak/88754/1 "2024-06-17T10:16:17Z")

</div>

Hello!  
I am a beginner with Node-RED and I want to send sensor data to thingspeak.  
I have already installed the thingspeak node and tested it with an injection node. Everything works fine.  
But now I have the problem that I want to send data from a sensor (e.g. integer value or a string) via the right node (which also contains a field for a topic like the injection node).  
I get the data (string) via the "Serial in" node  
Which node can I use to also send the topic?

BR, Heimo

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [17 June 2024 10:18 UTC](https://discourse.nodered.org/t/how-to-send-an-integer-value-with-an-topic-to-thingspeak/88754/2 "2024-06-17T10:18:09Z")

</div>

Hi and welcome to the world of `Node-red`.

I think the node you need is the `change` (yellow) node.

And when you open it, it defaults to the `payload`.

Change `payload` to `topic`, then in the line below that you enter what you want the `topic` to be.

Put the `change` node anywhere you want between the `serial in` node and the last node before the `thingspeak` node.

---

<div class="post-metadata">

### Author: ![ledi](https://avatars.discourse-cdn.com/v4/letter/l/ea666f/32.png) [@ledi](https://discourse.nodered.org/u/ledi)
#### Post date: [17 June 2024 12:41 UTC](https://discourse.nodered.org/t/how-to-send-an-integer-value-with-an-topic-to-thingspeak/88754/3 "2024-06-17T12:41:17Z")

</div>

Hi, im a little bit confused. I hope the pictures will help.

I get the payload via serial node and convert it from Sting To Integer. Then i set the change node (here Temperature) and from here to Thingspeak node.

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

I am not sure what i should write in the 2nd line because the topic should be the Temperature.

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

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [17 June 2024 14:33 UTC](https://discourse.nodered.org/t/how-to-send-an-integer-value-with-an-topic-to-thingspeak/88754/4 "2024-06-17T14:33:14Z")

</div>

Are you trying to set the topic to a fixed value? If so then select String where your arrow is pointing and type in the string. If not a fixed string then what?

---

<div class="post-metadata">

### Author: ![ledi](https://avatars.discourse-cdn.com/v4/letter/l/ea666f/32.png) [@ledi](https://discourse.nodered.org/u/ledi)
#### Post date: [17 June 2024 14:54 UTC](https://discourse.nodered.org/t/how-to-send-an-integer-value-with-an-topic-to-thingspeak/88754/5 "2024-06-17T14:54:17Z")

</div>

Hi,  
now it works 🙂

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

I set the payload to payload and the topic to the topic "Temperature" what i need as topic in the thinkspeak node.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [17 June 2024 14:58 UTC](https://discourse.nodered.org/t/how-to-send-an-integer-value-with-an-topic-to-thingspeak/88754/6 "2024-06-17T14:58:59Z")

</div>

You don't need the first Set, the payload is already the payload so you don't need to change it.  
The change node only changes properties that you mention. If you don't mention it then it will be left as it is.

---

<div class="post-metadata">

### Author: ![ledi](https://avatars.discourse-cdn.com/v4/letter/l/ea666f/32.png) [@ledi](https://discourse.nodered.org/u/ledi)
#### Post date: [18 June 2024 05:37 UTC](https://discourse.nodered.org/t/how-to-send-an-integer-value-with-an-topic-to-thingspeak/88754/7 "2024-06-18T05:37:55Z")

</div>

Yes, that sounds logical.  
Thank you!

---

<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: [16 September 2024 05:37 UTC](https://discourse.nodered.org/t/how-to-send-an-integer-value-with-an-topic-to-thingspeak/88754/8 "2024-09-16T05:37:57Z")

</div>

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