I am not getting why this error "Ambiguous paths to End"
Question

As mentioned in the screen shot. I used foreach loop and there are 2 ways to end 

1. after completing the loop 

2. false condition of if between the loop


When I got the error of ambiguous paths as mentioned in the picture I tried to use the another End point of false condition . 

But I am surprised that when I tried with 2 end points it resolves the error but not for 1 end point.
How it resolved, I am not properly get that what is the difference between both 

1. with 2 end points  (resolved the issue)

2. with single end point mentioned in the screen shots (getting error)


Can anyone let me know that why it behaves?

error1.png

mvp_badge
MVP

Hi Manish,

Dont have a concrete answer for why it is happening but i found a similar post and explanation from experts.

https://www.outsystems.com/forums/discussion/22031/is-there-any-way-to-exit-the-for-each-loop-before-the-loop-ends/


Regards,

-PJ-

mvp_badge
MVP

Hi Manish,

The reason is simply that you can never draw an arrow from inside a For Each to something outside a For Each. The End in your example is outside the For Each, since it's reached from the For Each after completion, so you cannot reach it inside the For Each.

Something comparable is the End of an Exception, that must also be its "own" End, and cannot point to an End of the main flow.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.