# Help with function node

**URL:** https://discourse.nodered.org/t/help-with-function-node/20333
**Category:** General
**Created:** [14 January 2020 20:22 UTC](https://discourse.nodered.org/t/help-with-function-node/20333 "2020-01-14T20:22:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![niclas.w82](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/niclas.w82/32/31813_2.png) [@niclas.w82](https://discourse.nodered.org/u/niclas.w82)
#### Post date: [14 January 2020 20:22 UTC](https://discourse.nodered.org/t/help-with-function-node/20333/1 "2020-01-14T20:22:27Z")

</div>

HI.

Have tried to get this work for a while now. Have read the documentation on the function node but I don't get how to solve this. I want multiple expressions I one node with an output for each expression.

 ![Skärmavbild 2020-01-14 kl. 21.13.46](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/e/ae6a568e5e85cb4b59d8f4aa9a10121c9debd897.png)

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [14 January 2020 20:29 UTC](https://discourse.nodered.org/t/help-with-function-node/20333/2 "2020-01-14T20:29:30Z")

</div>

Hi @niclas.w82

your code is close but does need a couple changes.

At the moment you are creating four messages whose payloads are the literal strings `"payload.events.batch...."`, instead of looking up the value of those properties from the received message.

You should change those lines to be:

```auto
var msg1 = { payload: msg.payload.events.batch....... };

```

(obviously use the full property path, I'm just not going to type the full thing out from a screenshot)

Then, your return statement should be:

```auto
return [msg1, msg2, msg3, msg4];

```

in order to send each message to the corresponding node output.

---

<div class="post-metadata">

### Author: ![niclas.w82](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/niclas.w82/32/31813_2.png) [@niclas.w82](https://discourse.nodered.org/u/niclas.w82)
#### Post date: [14 January 2020 20:35 UTC](https://discourse.nodered.org/t/help-with-function-node/20333/3 "2020-01-14T20:35:48Z")

</div>

Thank you wery much!!!

Work perfect!

> [@knolleary](#):
>
> return [msg1, msg2, msg3, msg4];
