ForEach Loop Not Working

ForEach Loop Not Working

Comments

  • Hi,

    Im having an issue with a flow not behaving how Id like. I am running a ForEach loop where it appears that the ForEach step doesnt iterate through the collection Im passing it. I have a rule within my ForEach loop that if true" will go back in the loop and "if false" will carry forward without going back to the loop. When the flow reaches the loop it seems to do nothing and immediately take the "done" path. Does anyone have any suggestions?"

  • Hello,

    It sounds like the problem is with how your rule is set up in the flow. When the if false" path is taken then the loop is left open which is likely causing your issue. You should use the "Reset ForEach Step" (found under flow management) to correct this behavior.

    If you dont have a "Reset ForEach Step" in your flow and you leave the loop then the ForEach step will "remember" what item in the collection it was on. The next time your flow runs then the ForEach step will begin at value X (the same spot in the collection it was on previously). After adding the reset step your ForEach loop will iterate through your collection from the beginning each time your flow runs.

    Let me know if this works for you."

  • That worked well - Thanks!

Sign In or Register to comment.