540
Views
4
Comments
Solved
Remove record from  list inside loop
Question
Application Type
Reactive

Hi All,

I am using ListRemove inside loop and it is giving me error.

Error - Remove is not a valid operation inside a StartIteration/EndIteration block.

How can i fix this issue.

Thanks In Advance

Piya

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


Hi,

You are trying remove record from a list and same list on loop.

it is not possible.

So do one thing-

1. Create a Copy of same list

2. Use loop on first list and remove record from Copy list.

3. Use copy list after loop end 

and you will get actual data.


Hope this will help you.


Regards

Rahul

2026-04-01 11-40-30
Mahesh Manchala

Hi,

Use local variable and ListRemove action.

Before using it, you need to iterate on your list, find out the row number of the item want to delete, and after the for each loop is complete you use the ListRemove using the row number as input parameter.



UserImage.jpg
Beatriz Ferreira

what if you have to delete multiple rows?

2024-02-08 13-00-21
Thales Ferraz


Raul's comment is very pertinent and solves the problem. I would just add that it is more advantageous to create a new list with the necessary items than to delete items from the list.


That is, you have your original list (which you are looping). You add OK items to a new list and DO NOT add items that would be deleted to the new list. At the end of the loop you use the new list instead of the original list.

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