# Change node to function node (newbie problem)

**URL:** <https://discourse.nodered.org/t/change-node-to-function-node-newbie-problem/57607>\
**Category:** Developing Nodes\
**Created:** [1 February 2022 21:11 UTC](https://discourse.nodered.org/t/change-node-to-function-node-newbie-problem/57607 "2022-02-01T21:11:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![thierry-rhone](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thierry-rhone/32/39551_2.png) [@thierry-rhone](https://discourse.nodered.org/u/thierry-rhone)\
**Post date:** [1 February 2022 21:11 UTC](https://discourse.nodered.org/t/change-node-to-function-node-newbie-problem/57607/1 "2022-02-01T21:11:30Z")

</div>

Hi,  
I would like to do the same thing as this node in a function node and I can't do it.

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

can you help me

Thanks

---

<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:** [1 February 2022 21:21 UTC](https://discourse.nodered.org/t/change-node-to-function-node-newbie-problem/57607/2 "2022-02-01T21:21:48Z")

</div>

```auto
msg.payload = msg.payload.e2movielist;
return msg;

```

An I missing something?

---

<div class="post-metadata">

**Author:** ![thierry-rhone](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thierry-rhone/32/39551_2.png) [@thierry-rhone](https://discourse.nodered.org/u/thierry-rhone)\
**Post date:** [1 February 2022 21:42 UTC](https://discourse.nodered.org/t/change-node-to-function-node-newbie-problem/57607/3 "2022-02-01T21:42:25Z")

</div>

> [@Steve-Mcl](#):
>
> ```auto
> msg.payload = msg.payload.e2movielist;
> return msg;
> 
> ```

Thank you Steve,  
That's what I thought but I had the answer

```auto
msg.payload : undefined
undefined

```

I copied your sentence as it is. Indeed it works

---

<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:** [1 February 2022 21:48 UTC](https://discourse.nodered.org/t/change-node-to-function-node-newbie-problem/57607/4 "2022-02-01T21:48:24Z")

</div>

Perhaps a spelling mistake? Also, remember, JavaScript is case sensitive.

Also, in case you don't already know, to avoid typos, you can you the copy path button...

### canned text...

There’s a great page in the docs 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)

> **[Working with messages : Node-RED](https://nodered.org/docs/user-guide/messages)**

---

<div class="post-metadata">

**Author:** ![thierry-rhone](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thierry-rhone/32/39551_2.png) [@thierry-rhone](https://discourse.nodered.org/u/thierry-rhone)\
**Post date:** [1 February 2022 22:40 UTC](https://discourse.nodered.org/t/change-node-to-function-node-newbie-problem/57607/5 "2022-02-01T22:40:04Z")

</div>

I found my problem.  
the variable to be analyzed was too large (\>60000 chr).  
(I had simplified the problem to ask my question)

```auto
msg.payload = msg.payload.e2movielist.e2movie;

```

it's ok

```auto
msg.payload = msg.payload.e2movielist.e2movie.e2title;

```

return a "indefinited" error  
What is surprising is that this change node returns the correct result

thank you for the time you spent answering me

---

<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:** [2 April 2022 22:40 UTC](https://discourse.nodered.org/t/change-node-to-function-node-newbie-problem/57607/6 "2022-04-02T22:40:23Z")

</div>

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