I need to do HTTP request on each url in array in Node.red. Basically I want to filter URLs by their API response. How do I do this? I cannot find any "loop" nodes or anything.
There's a splitter node (node-red-contrib-splitter) which splits a payload-array into separate messages. When a message (msg) arrives, the configured variable will be iterated over.
See: https://www.npmjs.org/package/node-red-contrib-splitter
Okay, solved it. I've made node that expects array of URLs in msg.items
and inserts them one by one in msg.payload
(request metadata goes to msg.itemData
), while collecting real msg.payload
into msg.itemsResult
. Switch after node decices to fire loop step or (if msg.payload == false
), fire "result pin".
After i got it working, I saw you can return two or more values from one node, by returning array of messages, so it should be possible to make loop in one node, w/o Loop Switch.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With