Filter a datable using .select and save in another datatable

Hi need help.

want to filter a datable using a column value and want the result in another datatable .

I have a datable with 6 column. column name “Status” has two values available and pending.

I want only datable with status column have “pending” value in it.

I have written below but it is not working donno why.
ExtractDataTable.Select("STATUS like ‘Pending’ ").copytodatatable()

Thanks

Hi @armamidwar,

Just modify your code with ExtractDataTable.Select("[STATUS]= ‘Pending’").copytodatatable()

Let me know if it is not work

TanQ,
Michael Udhaya

@armamidwar

Try like this:

ExtractDataTable.Select("[Status] = ‘Pending’").CopyToDataTable

Make sure here ColumnName is case sensitive and also hope you checked AddHeaders option in Read Range Activity.

Thanks for replying. Didn’t work

Can you post the Image of your headers and Code too?

Ensure you don’t have the two data table variable in single name.

Hi Mic,

TanQ, it worked.

my mistake - my datatable column doesn’t have any values with Pending . that’s was making error .

TanQ

Anil

Super Bro. Have a nice Coding!:+1:

hope u can help me with this.

I have two datatables. DT1 & DT2 . want to perform a vlookup .

from DT1 a value needs to be searched in DT2 when found, retrieve adjacent value or the row index of value found

TanQ,

Anil.

Yeah @armamidwar, you can simply use the UiPath.Core.Activities.LookupDataTable to do that.

Check this link.

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