Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

array-loop #11

Closed
nkolban opened this issue Jul 22, 2019 · 1 comment
Closed

array-loop #11

nkolban opened this issue Jul 22, 2019 · 1 comment

Comments

@nkolban
Copy link

nkolban commented Jul 22, 2019

When I run a sample flow I get an error from Array loop saying "Array is not array". Here is the flow that I am testing:

[{"id":"a80d83e2.deef3","type":"tab","label":"Flow 4","disabled":false,"info":""},{"id":"81c8aed9.81877","type":"inject","z":"a80d83e2.deef3","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":100,"y":180,"wires":[["3094c433.7366cc"]]},{"id":"3094c433.7366cc","type":"function","z":"a80d83e2.deef3","name":"","func":"msg.payload = [\"A\", \"B\", \"C\"];\nreturn msg;","outputs":1,"noerr":0,"x":290,"y":180,"wires":[["a582d76.fde6428"]]},{"id":"a582d76.fde6428","type":"array-loop","z":"a80d83e2.deef3","name":"","key":"al5654908587b9b","keyType":"msg","reset":false,"resetValue":"value-null","array":"payload","arrayType":"msg","x":530,"y":180,"wires":[["8f5a5b6b.9e0438"],["ab0e205c.6d1ba"]]},{"id":"8f5a5b6b.9e0438","type":"debug","z":"a80d83e2.deef3","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":720,"y":180,"wires":[]},{"id":"ab0e205c.6d1ba","type":"function","z":"a80d83e2.deef3","name":"","func":"\nreturn msg;","outputs":1,"noerr":0,"x":510,"y":240,"wires":[["a582d76.fde6428","9675db64.aceec8"]]},{"id":"9675db64.aceec8","type":"debug","z":"a80d83e2.deef3","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":680,"y":260,"wires":[]}]
@s1r-J
Copy link
Owner

s1r-J commented Jul 25, 2019

@nkolban

Array-loop node outputs an element of the array with msg.payload. So the array should not be assigned msg.payload. In the Following, I changed msg.payload to msg.array in your example.

[{"id":"50882c55.35f914","type":"inject","z":"75881813.cc4658","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":100,"y":180,"wires":[["896c75ad.c51298"]]},{"id":"896c75ad.c51298","type":"function","z":"75881813.cc4658","name":"","func":"msg.array = [\"A\", \"B\", \"C\"];\nreturn msg;","outputs":1,"noerr":0,"x":290,"y":180,"wires":[["b22d8ed7.e14a6"]]},{"id":"b22d8ed7.e14a6","type":"array-loop","z":"75881813.cc4658","name":"","key":"al5654908587b9b","keyType":"msg","reset":false,"resetValue":"value-null","array":"array","arrayType":"msg","x":520,"y":180,"wires":[["4307aef1.49885"],["ed09f638.5a5338"]]},{"id":"4307aef1.49885","type":"debug","z":"75881813.cc4658","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":720,"y":180,"wires":[]},{"id":"ed09f638.5a5338","type":"function","z":"75881813.cc4658","name":"","func":"\nreturn msg;","outputs":1,"noerr":0,"x":510,"y":240,"wires":[["b22d8ed7.e14a6","e84a6a8c.a08088"]]},{"id":"e84a6a8c.a08088","type":"debug","z":"75881813.cc4658","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":680,"y":260,"wires":[]}]

@s1r-J s1r-J closed this as completed Aug 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants