# Duplicate msg output (undefined and value)

**URL:** <https://discourse.nodered.org/t/duplicate-msg-output-undefined-and-value/84928>\
**Category:** General\
**Created:** [25 January 2024 21:45 UTC](https://discourse.nodered.org/t/duplicate-msg-output-undefined-and-value/84928 "2024-01-25T21:45:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ratigoal](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@ratigoal](https://discourse.nodered.org/u/ratigoal)\
**Post date:** [25 January 2024 21:45 UTC](https://discourse.nodered.org/t/duplicate-msg-output-undefined-and-value/84928/1 "2024-01-25T21:45:08Z")

</div>

Hi all,

I am new with Node-red and started with my AhoyDTU solar panels streaming values to an influxdb - worked perfect.

Now I am trying to stream my smart meter values via MQTT. Data are coming in perfect, but I have an issue when I split the values.

I use the function method as follows:

```auto
var value1 = { payload: msg.payload.Total };
var value2 = { payload: msg.payload.Supply };
return [value1, value2];

```

I get the values, but - each time I also get an output message that says undefined.

Anyone can support? Don't know what I do wrong ....

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/4/644292b7fe3df237a72639315f65878a6a534707.png)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [25 January 2024 21:54 UTC](https://discourse.nodered.org/t/duplicate-msg-output-undefined-and-value/84928/2 "2024-01-25T21:54:33Z")

</div>

What is the data coming in? Add a debug node (set to display the complete msg object) to the output of the node feeding the function node.

Then copy past the results to a reply

There’s a great page in the docs ([Working with messages : Node-RED](https://nodered.org/docs/user-guide/messages)) that will explain how to use the debug panel to find the right path to any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

![BX00Cy7yHi](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/d/bd1f333a9e043b061b39917c328b0094d3e52d30.gif)

---

<div class="post-metadata">

**Author:** ![ratigoal](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@ratigoal](https://discourse.nodered.org/u/ratigoal)\
**Post date:** [25 January 2024 22:06 UTC](https://discourse.nodered.org/t/duplicate-msg-output-undefined-and-value/84928/3 "2024-01-25T22:06:33Z")

</div>

Found it - it was due to the split node .....

---

<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:** [8 February 2024 22:07 UTC](https://discourse.nodered.org/t/duplicate-msg-output-undefined-and-value/84928/4 "2024-02-08T22:07:04Z")

</div>

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