As I couldn’t find an answer that Loops in Loops are possible without subworkflow, I wanted to share the solution we came up with to make that possible:
After inside Loops are done, set reset=true via Code Node: $('second loop').params.options.reset = true;
The Loop path of the inside Loop (“second loop”) needs to set reset=false via Code Node: $('second loop').params.options.reset = false;
Here I have an example Workflow to show how it works:
Interesting because I’ve never understood the need for the reset toggle.
Are you able to share any more details on your specific use-case? I’ve tried to run it myself with and without the reset calls in the code nodes and can’t quite tell the difference…
The difference is visible when you check the console outputs. I just ran it real quick, the first run (before the “xxxxxxxxxxx”) is with the reset in code nodes.
The second run (after the “xxxxxxxx”) is without the reset.
So the difference is, without the resets, the second loop only runs once. The subitems of the other 2 runs in the example are not looped in the second loop.
Thanks for the clarification… $('second loop').params.options.reset seems like it’s read-only for me which explains why I wasn’t seeing the difference. I’m on community edition v1.99.0.
Interesting technique nonetheless! Will give this a study and try to figure out what’s going on.
I do wonder if the nested loop not running for the other sub items should be reported as a bug? Seems like it should? My quick test case: The sub items for parent items 2 & 3 are not marked as seen when the main loop is done.