# Change Node: Is there a simple solution or should I stick with function node

**URL:** <https://discourse.nodered.org/t/change-node-is-there-a-simple-solution-or-should-i-stick-with-function-node/26195>\
**Category:** General\
**Created:** [6 May 2020 22:42 UTC](https://discourse.nodered.org/t/change-node-is-there-a-simple-solution-or-should-i-stick-with-function-node/26195 "2020-05-06T22:42:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tmichaeltx](https://avatars.discourse-cdn.com/v4/letter/t/73ab20/32.png) [@tmichaeltx](https://discourse.nodered.org/u/tmichaeltx)\
**Post date:** [6 May 2020 22:42 UTC](https://discourse.nodered.org/t/change-node-is-there-a-simple-solution-or-should-i-stick-with-function-node/26195/1 "2020-05-06T22:42:59Z")

</div>

In my msg object, I have a payload and another key named globalsource. I want to take the payload and put it into a global variable named global.(contents of msg.globalsource).

This is simple enough in a function node:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/f/8f82d26ffbd5bab75297d20ccdb787d5d33fcf92.png)

I am just wondering is there a method that I am overlooking to do this using a change node?  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/8/a84249490d3ba1c9befe492be27b92ba94a4f7e4.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:** [6 May 2020 23:03 UTC](https://discourse.nodered.org/t/change-node-is-there-a-simple-solution-or-should-i-stick-with-function-node/26195/2 "2020-05-06T23:03:27Z")

</div>

There is no way of doing that with the change node. You have to stick with the function node.

---

<div class="post-metadata">

**Author:** ![tmichaeltx](https://avatars.discourse-cdn.com/v4/letter/t/73ab20/32.png) [@tmichaeltx](https://discourse.nodered.org/u/tmichaeltx)\
**Post date:** [6 May 2020 23:07 UTC](https://discourse.nodered.org/t/change-node-is-there-a-simple-solution-or-should-i-stick-with-function-node/26195/3 "2020-05-06T23:07:35Z")

</div>

Thank for the quick reply.

---

<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 May 2020 23:07 UTC](https://discourse.nodered.org/t/change-node-is-there-a-simple-solution-or-should-i-stick-with-function-node/26195/4 "2020-05-20T23:07:39Z")

</div>

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