1176
Views
2
Comments
Solved
Help with repetitive loops "Detected a recursive iteration over the same list."
Question

Hi,


I'm trying to do a repetitive lops where my logic is simply looking through a list to see if a particular field is all the same status. I've done this by just looping through the same list over and over and asking IF(Status=Status A,true, false), however I'm getting the error: "Detected a recursive iteration over the same list." Howe do I get around this? How do i just keep looping through the same list? 

Image of logic attached. 


Capture.PNG
2019-04-25 14-57-49
Mike Neyman
Solution

If I understand correctly what you're trying to do, the addition For Each loops are unnecessary (I'm assuming you're looping over the same list 3 times).  There should only be a need to loop through the list one time, and all the logic should be tested on a single list item during each iteration.

Basically, if you loop through a list within a loop of the same list, there is no way of referencing the correct current value of that list.  If you must loop through a list multiple times, you should create your own counter variable, then increment and test that counter value (if counter > length of list) each time through, and have a distinct counter variable for each loop.

UserImage.jpg
Digital Developer

Yep, the counter done the trick, thanks for your help! Just couldn't think of it myself (still learning) 

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