Row delete in DataTable


#1

Hi,
I have create a datatable from screenscrapping, i want to remove some rows on the base of the length. And want the output as a datatable. Please let me know how can i achieve that.
Thank


#2

Hello @Dany069

You can loop through the data table using a for each row activity and inside that use an if activity to check your desired condition and remove row appropriately something like -

If row(“Name”).ToString.Length>20 then use activity Remove Data Row

Regards,
Rishabh.


#3

The remove data row didn’t work in For each row.


#4

What error are you getting?


#5

There is no error but the datatable give the output as blank. There is no row write in the datatable


#6

If possible can you show me some example so that i can relate the same


#7

Hi @Dany069,

DataTable.Select("LEN([ColumnName]) > 5").CopyToDataTable()


#8

Here you go @Dany069
I’m assuming here that we’re deleting a row if the length of item in column “ID” is less than 5.

test.xaml (6.6 KB)


#9

@Rishabh_Lakhera Yes but after deleting the rows. I want another Data table to create with remaining rows.


#10

Well in that case what @3726 said should work just fine :slight_smile:


#11

thanks for your help @Rishabh_Lakhera and @3726 issue resolve