Collection was modified; enumeration operation may not execute - unsure how to implement select solution


I am getting the error:
‘Collection was modified; enumeration operation may not execute’ when I have a delete data row activity in a for each. A previous post has suggested the solution to use the select function to overcome this but I’m really unsure how to implement this?

Please advise step by step how to do this

My logic is:

For reference here is the previous post with the solution: Collection was modified; enumeration operation might not execute

Hi @E.T.S,

Yes, you can’t use the “Remove Data Row” like that.

You have to use the “Filter Data Table” activity: Activities - Filter Data Table

Yours should look like this:


Then click “Configure Filter” and configure as needed (similar to this):


Juan P.


Thanks for your reply.

If I use the filter wizard this will remove all my duplicate rows. I would like the same number of duplicate rows in table A to be removed from table B.


Oh I see! So you want to remove duplicate rows, in that case you can you the “Remove Duplicate Rows” activity: Activities - Remove Duplicate Rows

Or maybe I’m not understanding your problem, if possible, share the workflow with us to better understand the logic.

Juan P.

I have two tables:

I would like to remove the duplicate rows in TableB - however I want to remove the rows by same number of duplicates as TableA

So in this case, there is one row of ‘a’ so I want one row of ‘a’ in TableB

The output would be: