# Suggestion about \`change\` node. Re-think

**URL:** <https://discourse.nodered.org/t/suggestion-about-change-node-re-think/27119>\
**Category:** General\
**Created:** [23 May 2020 08:38 UTC](https://discourse.nodered.org/t/suggestion-about-change-node-re-think/27119 "2020-05-23T08:38:29Z")\
**Posts on this page:** 12\
**Page:** 1

<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:** [23 May 2020 08:38 UTC](https://discourse.nodered.org/t/suggestion-about-change-node-re-think/27119/1 "2020-05-23T08:38:29Z")

</div>

I know it has been mentioned before - and probably will be mentioned again.

I am sure I have _complained_ about how it works with the commands:  
`SET`  
`CHANGE`  
`DELETE`  
`MOVE`

Not wanting to make it more complicated, but I just realised a suggestion on how it is shown.

`SET` is used to set things. Yeah, fairly understandable. But I was thrown just now while doing something.

When working in `function` nodes you can `context.set( )`, `flow.set( )` and `global.set( )`

These are used to set those variables.  
If you are doing the opposite, it is `get` rather than `set`.

So, in the `change` node it is (can be) confusing.  
I am wanting to _flow.get("something")_ and save that to the ...... _msg.payload_.

But the selection is `set`.  
It may be nicer if there could be a `get` option so the order the names are shown remains the same.  
_This was another thing which was brought up in previous discussions, as `set` and `move` work differently._

Do I need to elaborate more on this idea, or is it already dead in the water?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [23 May 2020 08:48 UTC](https://discourse.nodered.org/t/suggestion-about-change-node-re-think/27119/2 "2020-05-23T08:48:25Z")

</div>

How would it read in the config ?  
Get. flow.something ...  
I can’t see a simple phrasing that works compared to Set ... to... and move... to...

---

<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:** [23 May 2020 08:58 UTC](https://discourse.nodered.org/t/suggestion-about-change-node-re-think/27119/3 "2020-05-23T08:58:48Z")

</div>

Well,

 ![Screenshot from 2020-05-23 18-51-42](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/e/ee55d47aeaef68a269d70b6bd910143d569824ed.png)

To me it should say `Get` not set.

If I was coding in `JavaScript` it code would be:

`msg.payload = flow.get("name");`

As discussed in the past the node (`change`) \*pushes the data from the bottom field to the top one.  
So: `flow.name` is _moved_ to `msg.payload`.

It all falls apart when you `move`. Then it is from the top to the bottom field.

I know brainy people can see around this.

But adding a `get` option would (maybe) increase that it always goes in a certain direction with the two fields.

Bottom to top would be better I think. It shows you **who** is getting changed then from **where**.

`set` and `get` would help with the understanding of what is happening too.....

I think I just shot myself in the foot. My inability to explain things.

But as I said, while I was working on a recent problem I got into a bit of a mess wondering how the `msg.payload` was changed when none of the `change` nodes had a `get` in them.

---

<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:** [23 May 2020 11:01 UTC](https://discourse.nodered.org/t/suggestion-about-change-node-re-think/27119/4 "2020-05-23T11:01:25Z")

</div>

It is intended to read as:

> Set [top option] to the value of [bottom option]

If they were flipped around, you would no longer be able to start the sentence with "set".

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [23 May 2020 11:26 UTC](https://discourse.nodered.org/t/suggestion-about-change-node-re-think/27119/5 "2020-05-23T11:26:47Z")

</div>

and if it was flipped and labelled to say

```auto
Get [msg.payload] from [flow.foobar]

```

then the get would look like it applies to the msg,payload - when in fact it would be doing a `msg.payload = flow.get("foobar");` which doesn't line up with @Trying_to_learn mental model ... so i think we'll leave it there for now.

---

<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:** [23 May 2020 11:27 UTC](https://discourse.nodered.org/t/suggestion-about-change-node-re-think/27119/6 "2020-05-23T11:27:53Z")

</div>

> [@knolleary](#):
>
> If they were flipped around, you would no longer be able to start the sentence with "set".

Well, not really.

`get` `msg.payload` (from) `flow.name` works.

And from the picture (screen shot) it would still work.

---

<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:** [23 May 2020 11:35 UTC](https://discourse.nodered.org/t/suggestion-about-change-node-re-think/27119/7 "2020-05-23T11:35:31Z")

</div>

Errrr.....

I am more confused now.

 ![Screenshot from 2020-05-23 18-51-42](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/f/df3d2cb27e931db0676e4689e0301968e4800b0d.png)

Yes, new picture.

The original one (without the red `X`'s) bit me.  
As it is/was it is _setting_ `msg.payload` from `flow.name`.

The new way would be `get` `from`.  
So the directionality would remain.

The problem I have is (again) if I am doing that task from a javascript level.  
It is `flow.get` (ignoring the `flow` part).

But using the `change` node: irrespective of which way the data is going it is always `set`.

I am sorry. I was just not thinking straight (or in the right mindset - maybe) and it stuck out to/for me that there is this disparity in how things are done.

I don't believe I have actually expressed this aspect before. (Ok, maybe I did.) So I thought I would mention it and see if while discussing it that _things would fall into place_.

I'm not sure that has happened. But I don't want to argue for the sake of arguing. That's just silly.

I'd better stop now.

Thanks @dceejay and @dceejay.  
Sorry for the confusion.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [23 May 2020 11:41 UTC](https://discourse.nodered.org/t/suggestion-about-change-node-re-think/27119/8 "2020-05-23T11:41:07Z")

</div>

> [@Trying\_to\_learn](#):
>
> ..... @dceejay and @dceejay.  
> ..... confusion

🙂 definitely time for a break... !

---

<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:** [23 May 2020 11:45 UTC](https://discourse.nodered.org/t/suggestion-about-change-node-re-think/27119/9 "2020-05-23T11:45:46Z")

</div>

Yup.

Definitely.

(I can't believe I've been coming here for 2 years! And the google group before that!)

You'd have thought that in that time I would have learnt something. 😉

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [23 May 2020 12:02 UTC](https://discourse.nodered.org/t/suggestion-about-change-node-re-think/27119/10 "2020-05-23T12:02:40Z")

</div>

Hey Andrew - if you shift to using @BartButenaers Blockly node, then you can have the best of both worlds 🙂

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

Removes all ambiguity 🙂

---

<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:** [23 May 2020 21:17 UTC](https://discourse.nodered.org/t/suggestion-about-change-node-re-think/27119/11 "2020-05-23T21:17:44Z")

</div>

Yeah, I've seen it and read about it.

It is something I may get done one day.

I'm just not confident enough just yet to do it.

---

<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:** [22 July 2020 21:17 UTC](https://discourse.nodered.org/t/suggestion-about-change-node-re-think/27119/12 "2020-07-22T21:17:45Z")

</div>

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