Delete datarow in datatable

datatable
excel
activities

#1

Hi,

How do you delete currently datarow without use Excel.
I use in my for Each Row the “Remove Data Row” activity. But i don’t know how you fill the row and row index in options…

Thanks


#2

you either fill one or the other.
Row: here you would add the variable used in the For Each activity (presumably row).
RowIndex: here you would add the row index in case you don’t have a var. ie. if you add 0 it will delete the first row, 1 will delete the second row and so on…


#3

You cannot remove rows while iterating a datatable(dt.Rows).

You need to Perfrom dt.Select —> and remove rows from Foreach DataRow Array

Or

Inside Foreach dt.Rows—> Add your to be deleted rows into List and then delete those rows in Foreach List Iteration.


#4

@vvaidya I saw you can use a reverse for loop in order to not change collection.
Is it possible to do that ?


#5

Hey

May be this post will help you:

Regards…!!
Aksh


#6

Good Job


#7

this is working fine.thank you.

but if instead of passing PV directly i am having this PV in one string variable then how can i pass ?

and how can i pass if am having 2 conditions for example, if status= “PV” and name =“akash”