612
Views
6
Comments
Detected a recursive iteration over the same list and index  is out of range error
Application Type
Traditional Web
Service Studio Version
11.10.3 (Build 36711)

I have a searchable table that reads from list when using a specific filter after filtering it gives me 2 errors as the attached screenshot  : 

  • Detected a recursive iteration over the same list.
  • index 1 is out of range

note that the number of elements on the table before searching is 1 .

after searching i assign the new fetched records to the list that the table is reading from.

when refreshing the table i get theese errors.

search button is set to ajax submit.

I've extracted the refresh widget to a new action which is executed by a widget click  and the same problem exists 

2026-02-26 06-29-24
Rahul
 
MVP

Hi  Muhamed Akl,

create one varibale for list with same datatype like - listcopy

when ever you assign data copy all data in a list and using loop on it.

if you are using two time loop on a same list than this issue occur so use second time copy list .


Regards

Rahul


UserImage.jpg
Muhamed Akl

Hi @Rahul Sahu ,

I've tried to assign the list to a new vairable of the same type and the same problem occurs.

I'm not iterating on the list in the search action, not even once, I'm iterating it on a single loop in the prepration only and that doesn't cause any problem, the problem only occurs when i try to filter the list 

2026-02-26 06-29-24
Rahul
 
MVP

can you share oml or screen shot of your code.


UserImage.jpg
Muhamed Akl

there are no loops in this action (search action)

2020-07-02 13-32-59
Max de Groot

Hi Muhamed,

The index 1 is out of range error pr7obably has something to do with the start index of the loop. The default index is 0, so if you only have 1 record in the table only index 0 will exists. If you make the loop start at index 1 it will be out of bounds. 

If I understand correctly you are looping the list first, appending records to that same list and then trying to go through it again before returning the first loop, correct? You will have something like this.


This is not allowed an will give you the recursive iteration error. I am not really sure what you are trying to accomplish with your search so providing the answer is difficult. You are trying to filter a list that has 1 record, but the filtering should get records from a different table and append them to the list? 

UserImage.jpg
Muhamed Akl

Hi @Max de Groot ,

I'm looping on the list in the preparation and that has no problems,

the list is initially filtered when opening the screen , the user has the option to change or clear the filter,

I'm not looping on the list in the search action (not even once ), the search action only excutes the query with the new filter arguments and return the new filtered list (the new list contains the filtered result correctly ), then refreshing the table widget, theese errors occurs when refreshing the table , the looping is performed only in the preparation and the start index is set to 0 

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