How to store two different ARRAY in a variable in the flow, and JOIN in a new unique array?

Dear all,
I have a particular device, that gives me an array when I ask the value.
I have two or more of this devices.
How can I save/store "Array" from "A" and "B" and so on... in a "flow.set" variable or something similar, and then, in a new function node, reload the arrays and JOIN the ARRAYs to otbain a new longer array with all value? (example in the image.)
Thanks in advance.

You could start with a join node to get the data in one msg. Then you can use a change node (using jsonata) or function node to concatinate the arays

Here is a simple example using the change node:

[{"id":"df0e4b16d664bfea","type":"inject","z":"fd802e9f483fc9fa","name":"base","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"BASE","payload":"[16,663,245,297,1457,45]","payloadType":"json","x":250,"y":100,"wires":[["2f3e548eca3b9ca3"]]},{"id":"ca807504efb1d5d9","type":"inject","z":"fd802e9f483fc9fa","name":"remote","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"REMOTE","payload":"[14,605,260,24,297,60]","payloadType":"json","x":250,"y":200,"wires":[["2f3e548eca3b9ca3"]]},{"id":"2f3e548eca3b9ca3","type":"join","z":"fd802e9f483fc9fa","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":450,"y":140,"wires":[["088d98afdabafa8f"]]},{"id":"66fec8013da0050e","type":"debug","z":"fd802e9f483fc9fa","name":"debug 5","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":840,"y":140,"wires":[]},{"id":"088d98afdabafa8f","type":"change","z":"fd802e9f483fc9fa","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$append(payload.BASE, payload.REMOTE)\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":140,"wires":[["66fec8013da0050e"]]}]

Thank you, thank you, very much!
Issue solved!

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