# Need help with my subflow - deepcopy msg problem

**URL:** <https://discourse.nodered.org/t/need-help-with-my-subflow-deepcopy-msg-problem/61796>\
**Category:** General\
**Created:** [26 April 2022 10:52 UTC](https://discourse.nodered.org/t/need-help-with-my-subflow-deepcopy-msg-problem/61796 "2022-04-26T10:52:11Z")\
**Posts on this page:** 14\
**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:** [26 April 2022 10:52 UTC](https://discourse.nodered.org/t/need-help-with-my-subflow-deepcopy-msg-problem/61796/1 "2022-04-26T10:52:11Z")

</div>

I am trying to write my own `filter` (RBE) node but its mode can be changed with commands.

It works for simple things, but when I get a complex message it doesn't seem to work.

Here is a flow with the subflow in it.

There are options to _configure_ the subflow.  
The default (startup) mode and you need to set the `topic` for the control messages.  
And - lastly - if it also uses the message topic for comparing messages. (Not perfect, but....)

The commands are:  
STOP  
ALL  
BLOCK  
ONE

Anyway, here's the code:

```auto
[{"id":"5a6ca5972b0f9e7b","type":"subflow","name":"Advanced blocker","info":"You need to set the `env` variable `TOPIC` to set the control topic.\nInput values:\n - STOP - basically don't pass ANY message.\n - ALL - pass all messages.\n - BLOCK - block repeats of same message.\n - ONE - pass ONLY the next message to arrive. (ONE)","category":"","in":[{"x":170,"y":130,"wires":[{"id":"685360a3.c08db8"}]}],"out":[{"x":550,"y":130,"wires":[{"id":"685360a3.c08db8","port":0}]}],"env":[{"name":"TOPIC","type":"str","value":""},{"name":"DEFAULT_MODE","type":"str","value":""},{"name":"topic_mode","type":"bool","value":"false","ui":{"type":"input","opts":{"types":["bool"]}}}],"meta":{},"color":"#3FADB5","icon":"node-red/function.svg","status":{"x":550,"y":190,"wires":[{"id":"197b01d950cf86b4","port":0}]}},{"id":"685360a3.c08db8","type":"function","z":"5a6ca5972b0f9e7b","name":"My blocker node. V6.1b","func":"////////////////////////////////////////////////////////////////////////////////\n// Version 6.1\n// 2022 04 25\n// Added topic specific blocking or generic\n// This is mentiond below on earlier update but not applied.\n\n// The shape property can be: ring or dot.\n// The fill property can be: red, green, yellow, blue or grey\n\n// These are the three commands accepted.\nconst all = \"ALL\"; // Allow all message to pass\nconst block = \"BLOCK\"; // Block repeat message (of same topic)\nconst one = \"ONE\"; // Allow ONE message to pass. (may not be perfect)\nconst stop = \"STOP\"; // Block ALL message... ALL!\n// Get topic\nvar topic = msg.topic;\nif (topic == \"\")\n topic = \"BLANK\";\nif (msg.topic == undefined)\n topic = \"BLANK\";\n// Get new value from message\n\n\ntopic_mode = env.get(\"topic_mode\") || \"\";\nif (topic_mode.length < 1)\n{\n // ***** \n topic_mode = false;\n}\nif (topic_mode == false)\n topic = \"BLANK\";\n\n// Used to determine if a message was received to change the mode.\nvar updated_mode = context.get(\"updated_mode\") || 0;\n\n////////////////////////////////////////////////////////////////////////////////\n//\n// 2022 03 06\n//\n// Needs work here as the *default* topic is being reset\n// every time a new message comes through.\n// Set `updated_mode` to `1` so it won't be called again.\n\n// See if there is a DEFAULT MODE set.\nif (updated_mode == 0)\n{\n let default_mode = env.get(\"DEFAULT_MODE\");\n if (default_mode.length > 0)\n {\n //\n context.set(\"MODE\",default_mode);\n context.set(\"updated_mode\",1)\n }\n}\n\ncontext.set(\"MODE\",\"BLOCK\");\ncontext.set(\"updated_mode\",1)\n\n//node.warn(\"Topic is set to \" + topic);\n\nvar lastval = context.get(topic);\n//node.warn(\"Stored value is \" + lastval);\n\n\nvar newval = msg.payload;\ncontext.set(topic,newval);\n\n\n// Get the topic used to determine which messages are to control the mode.\nlet CTLTopic = env.get(\"TOPIC\");\nif (CTLTopic.length < 1)\n throw\"You must define a TOPIC for controlling the node\";\nCTLTopic = \"MODE\";\n\nif (msg.topic == CTLTopic)\n{\n //\n // Set how node works.\n //\n\n if (msg.payload == stop)\n {\n node.status({ text: \"Set to stop\" });\n context.set(\"MODE\",msg.payload);\n node.warn(\"Set to STOP\");\n context.set(\"BLANK\",\"\"); // 2022 04 26\n } else if (msg.payload == block)\n {\n node.status({ text: \"Set to block\" });\n context.set(\"MODE\",msg.payload);\n node.warn(\"Set to BLOCK\");\n } else if (msg.payload == all) \n {\n node.status({ text: \"Set to allow\" });\n context.set(\"MODE\",msg.payload);\n node.warn(\"Set to ALL\");\n context.set(\"BLANK\",\"\"); // 2022 04 26\n } else if (msg.payload == one) \n {\n context.set(\"previousMode\",context.get(\"MODE\"));\n node.warn(context.get(\"previousMode\"));\n node.status({ text: \"Set to once\" });\n context.set(\"MODE\",msg.payload);\n } else // Show valid commands.\n {\n node.warn(\"For control of the node's mode msg.payload must be `\" + all + \"` `\" + block + \"` or `\" + stop + \"` or `\" + one +\"`\");\n };\n// context.set(\"updated_mode\",1); 2022 03 06 no longer needed\n return;\n}\n\n\n\n// -- Main code starts here.\n\n// Get status from context.\nvar mode = context.get(\"MODE\");\n\n// =============== STOP\n//else if (mode == \"STOP\")\nif (mode == stop)\n{\n return;\n}\n// =============== ALL\n//else if (mode == \"ALL\")\nelse if (mode == all)\n{\n node.status({fill:\"blue\",shape:\"dot\",text:\"All\"});\n context.set(topic, newval);\n return msg;\n}\n// =============== BLOCK\n//if (mode == \"BLOCK\")\nelse if (mode == block)\n{\n //\n // See if the new value is different to the old value.\n //\n //node.warn(\"Old value \" + lastval);\n //node.warn(\"New value \" + newval);\n if (newval != lastval)\n {\n context.set(topic, newval);\n node.status({fill:\"green\",shape:\"dot\",text:\"Passed\"});\n return msg;\n }\n node.status({fill:\"red\",shape:\"dot\",text:\"Blocked\"});\n return;\n}\n// =============== ONE\n//else if (mode == \"ONE\")\nelse if (mode == one)\n{\n //\n // Allow only 1 message to pass\n //\n// mode = context.get(\"MODE\");\n node.warn(\"Allowing ONE message\");\n context.set(topic, newval);\n context.set(\"MODE\",context.get(\"previousMode\"));\n// context.set(\"MODE\",\"BLOCK\");\n node.status({ text: \"Set to \" + context.get(\"previousMode\") });\n return msg;\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":130,"wires":[[]]},{"id":"197b01d950cf86b4","type":"status","z":"5a6ca5972b0f9e7b","name":"","scope":["685360a3.c08db8"],"x":310,"y":190,"wires":[[]]},{"id":"7d9e2fcda831d99d","type":"subflow:5a6ca5972b0f9e7b","z":"e2bd5a4e.5597e8","name":"","env":[{"name":"TOPIC","value":"MODE","type":"str"},{"name":"DEFAULT_MODE","value":"BLOCK","type":"str"}],"x":3530,"y":3700,"wires":[["c5ef9215d84dccbe"]]},{"id":"32a409f5fd84f06c","type":"inject","z":"e2bd5a4e.5597e8","name":"ALL","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"MODE","payload":"ALL","payloadType":"str","x":3490,"y":3750,"wires":[["7d9e2fcda831d99d"]]},{"id":"ac49686314b4f056","type":"inject","z":"e2bd5a4e.5597e8","name":"STOP","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"MODE","payload":"STOP","payloadType":"str","x":3490,"y":3780,"wires":[["7d9e2fcda831d99d"]]},{"id":"9bf5730521cb69fc","type":"inject","z":"e2bd5a4e.5597e8","name":"BLOCK","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"MODE","payload":"BLOCK","payloadType":"str","x":3490,"y":3810,"wires":[["7d9e2fcda831d99d"]]},{"id":"6338a36f02faeb52","type":"inject","z":"e2bd5a4e.5597e8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"A","payloadType":"str","x":3310,"y":3660,"wires":[["7d9e2fcda831d99d"]]},{"id":"e76dd88b6b55e6fe","type":"inject","z":"e2bd5a4e.5597e8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"B","payloadType":"str","x":3310,"y":3700,"wires":[["7d9e2fcda831d99d"]]},{"id":"c5ef9215d84dccbe","type":"debug","z":"e2bd5a4e.5597e8","name":"THIS ONE","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":3770,"y":3700,"wires":[]},{"id":"c87a643f85876c29","type":"inject","z":"e2bd5a4e.5597e8","name":"A","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"A","payloadType":"str","x":3310,"y":3820,"wires":[["7d9e2fcda831d99d"]]},{"id":"09015bb9ca6ebb1b","type":"inject","z":"e2bd5a4e.5597e8","name":"B","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"something","payload":"B","payloadType":"str","x":3310,"y":3870,"wires":[["7d9e2fcda831d99d"]]},{"id":"4702523e25f6b9a9","type":"inject","z":"e2bd5a4e.5597e8","name":"C","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"something","payload":"C","payloadType":"str","x":3310,"y":3920,"wires":[["7d9e2fcda831d99d"]]},{"id":"6480d3903931e9d5","type":"inject","z":"e2bd5a4e.5597e8","name":"B","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"B","payloadType":"str","x":3310,"y":3780,"wires":[["7d9e2fcda831d99d"]]},{"id":"e4e3bbeea1dbf510","type":"inject","z":"e2bd5a4e.5597e8","name":"B","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"B","payloadType":"str","x":3310,"y":3740,"wires":[["7d9e2fcda831d99d"]]},{"id":"30f467b5b4a4a15a","type":"inject","z":"e2bd5a4e.5597e8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":3190,"y":3570,"wires":[["92391f004a2e5fe2"]]},{"id":"92391f004a2e5fe2","type":"function","z":"e2bd5a4e.5597e8","name":"","func":"msg.payload = {\"Who\":\"TimePi\",\"device\":\"UpLink\",\"UpLink\":\"Online\"};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":3350,"y":3570,"wires":[["7d9e2fcda831d99d","e4527527d935cf62"]]},{"id":"e4527527d935cf62","type":"debug","z":"e2bd5a4e.5597e8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":3510,"y":3570,"wires":[]},{"id":"9264231b45e9c232","type":"comment","z":"e2bd5a4e.5597e8","name":"This part works.","info":"","x":3140,"y":3780,"wires":[]},{"id":"b7033b3b5a07e475","type":"comment","z":"e2bd5a4e.5597e8","name":"Doesn't work.","info":"","x":3360,"y":3530,"wires":[]}]

```

If I am injecting the _Working_ nodes, it seems to do as it is told/set.

But the top bit/part is where it all falls apart.  
I'm guessing that the message (payload) isn't stored correctly so when it comes through again it isn't being blocked.

So what's the _trick_ to get the message _remembered_?

---

<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:** [26 April 2022 11:30 UTC](https://discourse.nodered.org/t/need-help-with-my-subflow-deepcopy-msg-problem/61796/2 "2022-04-26T11:30:12Z")

</div>

Without looking at your code in any depth, my suspicion is you need to clone before storing / restoring from context.

Example...

![chrome_vRjpFbjZOX](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/c/8c4d0441c50da3c885ad1f7c99d17e534d93ff04.gif)

PS ↑ these are the benefits of switching to the monaco editor

also, you would see other issues...

![chrome_HMMRPbSNi0](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/5/856189307671ad36a375afc12c07baf3706e61cd.gif)

---

<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:** [26 April 2022 20:51 UTC](https://discourse.nodered.org/t/need-help-with-my-subflow-deepcopy-msg-problem/61796/3 "2022-04-26T20:51:17Z")

</div>

Yeah, I am going to have to get the finger out and install that editor some day.

That first bit  
`const copy = RED.util.closeMessage(msg)`  
That looks like the main problem, but where would I have found out about it?

And why `const`? This changes with every new incoming message.  
And again with the `newval`.... why `const`?

Thanks though.

---

<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:** [26 April 2022 21:07 UTC](https://discourse.nodered.org/t/need-help-with-my-subflow-deepcopy-msg-problem/61796/4 "2022-04-26T21:07:51Z")

</div>

> [@Trying\_to\_learn](#):
>
> Yeah, I am going to have to get the finger out and install that editor some day.

edit settings.js & restart & refresh - done!.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/3/93c909b2fd6d8afb184fad16f3bb3a7bad3e14ff.png)

  

> [@Trying\_to\_learn](#):
>
> `const copy = RED.util.closeMessage(msg)`  
> That looks like the main problem, but where would I have found out about it?

In [the docs](https://nodered.org/docs/user-guide/writing-functions#red)

> - `RED.util.cloneMessage(..)` : safely clones a message object so it can be reused

  

> [@Trying\_to\_learn](#):
>
> And why `const` ? This changes with every new incoming message.

Every time a function is executed, the `const`s, `let`s, `var`s are all created - EVERY TIME.  
Use const to avoid redefinition within the function (helps you avoid issues).

---

<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:** [26 April 2022 21:11 UTC](https://discourse.nodered.org/t/need-help-with-my-subflow-deepcopy-msg-problem/61796/5 "2022-04-26T21:11:04Z")

</div>

Yeah, sorry about not knowing... I never got that deep into coding alas. When I did it, it was a very different thing and even then, I was at/in the shallow end of the pool.

Onto the editor:  
So.... `lib: "ace"`.... is that a normal program on the RasPi (for that machine) and what if I am using Ubuntu on some?  
(I feel I have to ask, or I am going to get into a mess very quickly)

If I am understanding that about the _editor_ I `ssh` to one of the RasPi and typed in `ace`....  
`Command not found`. ☹

```auto
pi@TimePi:~ $ ace
-bash: ace: command not found
pi@TimePi:~ $

```

Oh that machine is running buster.

---

<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:** [26 April 2022 21:16 UTC](https://discourse.nodered.org/t/need-help-with-my-subflow-deepcopy-msg-problem/61796/6 "2022-04-26T21:16:49Z")

</div>

You literally just open the settings.js file in the .node-red folder & set the value as I showed.

ace & monaco are not executables, they are web based editors built in to node-red v2.x

---

<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:** [26 April 2022 21:17 UTC](https://discourse.nodered.org/t/need-help-with-my-subflow-deepcopy-msg-problem/61796/7 "2022-04-26T21:17:31Z")

</div>

Oops. Ok. Shall try now.

T'would be nicer if you showed the closing of the `{` but I'm guessing all there is are comments in yours.  
My `settings.js` file doesn't have any of that in it, so I am hoping that all I need is to add the line (with correct indenting) like this:

```auto
codeEditor: {
    lib: "ace",
}

```

But I have a sneaky suspicions there may be more to it because of the `,` inside the `{` and `}`  
(oh NR 2.2.2)

```auto
tarting as a systemd service.
Error loading settings file: /home/pi/.node-red/settings.js
/home/pi/.node-red/settings.js:219
    codeEditor:{
    ^^^^^^^^^^
SyntaxError: Unexpected identifier
    at wrapSafe (internal/modules/cjs/loader.js:1001:16)
    at Module._compile (internal/modules/cjs/loader.js:1049:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:101:18)
    at Object.<anonymous> (/usr/lib/node_modules/node-red/red.js:136:20)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
nodered.service: Succeeded.

```

As I suspected.  
☹

---

<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:** [26 April 2022 21:28 UTC](https://discourse.nodered.org/t/need-help-with-my-subflow-deepcopy-msg-problem/61796/8 "2022-04-26T21:28:01Z")

</div>

I need to learn to read.

`find this`..... **not found**. Sorry.

---

<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:** [26 April 2022 21:39 UTC](https://discourse.nodered.org/t/need-help-with-my-subflow-deepcopy-msg-problem/61796/9 "2022-04-26T21:39:59Z")

</div>

If you have upgraded from node-red V1 to V2 at some point, your settings file will be old & missing many new settings & features.

This is the default settings file for reference: [node-red/settings.js at 4acb66fb7a4c50ba237248ac61b20f0472526d08 · node-red/node-red · GitHub](https://github.com/node-red/node-red/blob/4acb66fb7a4c50ba237248ac61b20f0472526d08/packages/node_modules/node-red/settings.js#L344-L365)

---

<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:** [26 April 2022 21:43 UTC](https://discourse.nodered.org/t/need-help-with-my-subflow-deepcopy-msg-problem/61796/10 "2022-04-26T21:43:15Z")

</div>

Thanks...

But I'm confused - as usual.

Ok, Yes, I updated to NR 2.x and the settings.js file didn't update.  
Well, maybe it did, but when _restored_ my stuff, it probably overwrote that. (Opps?)

But if I add the valid entry for the `codeEditor` why would it spit the dummy?  
(Semi rhetorical)

I'll look at that link and see what I can work out.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [26 April 2022 21:50 UTC](https://discourse.nodered.org/t/need-help-with-my-subflow-deepcopy-msg-problem/61796/11 "2022-04-26T21:50:52Z")

</div>

> [@Trying\_to\_learn](#):
>
> Ok, Yes, I updated to NR 2.x and the settings.js file didn't update.

No it won't, you have to do that manually and keep your settings.js file up to date.  
The node-RED release notes always tells you about what changes are needed.

---

<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:** [26 April 2022 21:55 UTC](https://discourse.nodered.org/t/need-help-with-my-subflow-deepcopy-msg-problem/61796/12 "2022-04-26T21:55:02Z")

</div>

Ok, I stand corrected. But _if_ they/it were/was updated, as I said: I would have overwritten it when I threw my stuff in there.

I'm looking at the file now (the settings.js) one.

Yeah, this is going to be fun.

---

<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:** [26 April 2022 22:14 UTC](https://discourse.nodered.org/t/need-help-with-my-subflow-deepcopy-msg-problem/61796/13 "2022-04-26T22:14:09Z")

</div>

The editor is working, but only just.  
The _theme_ isn't quite working, but that isn't **End of the world** for me.

I'll get back to that once I get the actual problem resolved.

So @Steve-Mcl this..... `RED.util.cloneMessage(msg)`.....  
I've looked at the link you posted (down the bottom) and read:

```auto
RED

    RED.util.cloneMessage(..) : safely clones a message object so it can be reused

```

That means both everything and nothing to me.

I see a command, and what it does, but not how to use it. (Well, it could be argued I am shown how to _use_ it, but not fully.)

Once I've done that, then what?  
There is no continuation on with explaining anything about it.

Ok, my problem....

Sorry... I'll see what I can find.

---

<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:** [25 June 2022 22:14 UTC](https://discourse.nodered.org/t/need-help-with-my-subflow-deepcopy-msg-problem/61796/14 "2022-06-25T22:14:30Z")

</div>

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