I would like to make a loop over a list of items and merge them with data from a node outside the loop
It works for the first loop, but an error occurs for the second loop
My guess is that data from the external loop are consumed, but I don’t know how to reset them
Hey @ppcm why would you need Loop node to merge those data sets? Remove the Loop and it will work. If you want to avoid the items with the same values (duplicates) just add Remove Duplicates node after Merge node.
Thanks @ppcm , Though I still do not understand why you need the Merge node in the Loop and not before it. Merge the outputs of Code nodes prior to feeding the data to the Loop node. It just a matter of configuring Merge to your needs. Visually I expect to see something like this
Thanks @ihortom for the suggestion, but I don’t understand how the loop is done only on elements in the reference list
With this suggestion, I will have a file for each element in Data list too. Am I wrong?
In fact, I don’t understand how Data list is splited depending of refecences list in your exemple
It just a matter of configuring Merge to your needs.
The Merge node has many options. You can configure it to output the reference list enriched with data from “Data” node. To make it clearer, consider the options shown below. I’m not sure what data you need to start looping over them to give you definite answer but I believe that Merge node can provide for your use case.
Thanks @ihortom for the information (I knew that )
But now, with your workflow, how to split data to generate one file per reference (generated in node “List of references”)?