Delete Rows in Datatable based on Value in one Column

Hi there, I am scraping a web table to a data table, and then incorporating an if statement (if the 4th column has a value that’s less than 50) then remove the data row. However, I am having trouble finding the correct vb expression. I tried using Int32.Parse(row(4).ToString) < 50 (based on previous forums) to no avail. Any help would be greatly appreciated.

buddy @mgartner
in this case yu can use Filter datatable buddy
were you can mention the condition and the value ad you also you can remove those rows with value and create a new output datatable buddy
like this @mgartner
image
Cheers

Hi @Palaniyappan
I have tried doing this as well and it does not work. I tried including the column name (both “Units” and Column-4 as shown in the extracted data table). I’m not sure what else to do in this case.

Buddy may i have a sample excel so that i can send you a xaml buddy
Cheers @mgartner

Will that work even if I am not using an excel sheet? I appreciate the help.

yes ofcourse, you just need to pass the datatable variable which can be obtained from workbook activities that doesnt need excel buddy @mgartner
from here
image
Cheers

Ok, whenever I try to include the column name it keeps saying that the column name is not set or invalid. How can I fix this issue?

how did you mention buddy @mgartner
it must be in between quotes buddy @mgartner

I first tried “Units” then I tried “Column-4”

Neither of these worked.

“Units” is the header for the column

1 Like

buddy is these columns are there in workbook buddy and kindly check whether you have enabled the Add header property while read range activity is used
or still not
you can mentionthe column index like this buddy, say if your unit column is the third column and column-4, the fourth column
then mention like this buddy where 2 and 3 are column index which usually starts from 0

image

Cheers @mgartner

were you able to get now buddy @mgartner

Hi there, I am bit confused. You keep mentioning the workbook, but I am trying to filter the datatable itself without using excel. It seems that the read range command requires a workbook path and write range requires a sheet, both of which are used in excel. what command would you need to directly read the datatable?

1 Like

Buddy…if you have a datatable on hand readily…no worries you can directly pass that to filter datatable activity buddy…or if you dont have i suggested to get from a build datatable activity by building a datatable without excel or if you have excel you can get from that as well with read range as well…anyhow you dont want that…so that one is clear buddy

Next yes there are actually two set of activities like excel and workbook activities…
Excel activities are exclusively made for excel
Alone amd workbook activities can be used for both excel and other workbook applications…so you can use it even if you dont have excel buddy…
Simple buddy
Cheers
Hope i made this time clear @mgartner
Still any issues no worries lets sort this out buddy…