Delete row from another datatable

Hi, Is it possible to delete row from another datatable while in a for each row of a datatable?
I have a clone datatable. So during the for each, i remove row from the cloned datatable, add add row to a new datatable, while using the current datatable as a loop through.

Currently, it shows Remove Data Row: The given DataRow is not in the current DataRowCollection. as error.


Generally, if we want to remove some row from (another) datatable, we need some information to identify which row should be removed.
Can you elaborate more details and/or share your workflow?



Hi, the flow is like this briefly. For each row in the fileDT, if matches the condition, it’ll add to the addDT, and remove from the removeDT. addDt is cloned to get the same headers as fileDT, where there is no other data. removeDT is Copied from fileDT, with all the data.


Can you try the following sample? (13.8 KB)


1 Like

@Username95 I’m not sure if the Screenshot is not properly visible to me or for everyone else as well, it’s kind of blur :sweat_smile:

If you use “For each row” you cannot delete rows, becuase that would scramble the number of rows and “for each” will fail. You still can do that, but starting from the last row to the first, using a loop. I would reccomend you using activity Filter Data Table instead, which can remove certain rows from the same table.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.