How to filter a datatable and delete rows treated

Hi

I have an Input file as excel; I would like to treat it this way:
1- read the file and store it in a dataTable,
2- from this DataTable I make a filter which allows me to take all the rows which contain the same mail (column “email”) And column “ClientNum”
this filter allows me to treat all invoices by client at once and send them in a single email. To client
Once I finish whith the first client I treat the second, third …. To end of file

My condition to filter is the string of in the email column and the Client Number in the column ClientNum

once I finish treating a client I have to add it to a list so that I don’t reprocess it again. or delete it from my dataTable
I put you an excel file as an example

I want to do this filter

  1. Get unique Client Nums in a Datatable
  2. Loop over this datatable and filter with Client Num

Will upload a sample in a while.

Regards,
Nithin

Here is a sample workflow, with sample data that you can co-relate with:

Filter_DataTable_BasedOnUnique_Values.zip (39.6 KB)

Hope this helps. Kudos :robot:

Regards,
Nithin

hi @Nithin_P

Thank you a lot
it’s a very good solution
but if i want to use a second condition in my filter,
how should I do?
I used this

But it didn’t work

Thank you in advance

I’ll update code accordingly and share it with you in a while.

Regards,
Nithin

Here is the updated workflow:
Filter_DataTable_BasedOnUnique_Values_Updated.zip (21.4 KB)

What was updated ? :robot:
Added email to the Default View:
InputDt.DefaultView.ToTable(True,“Client Num”,“Email”)

Regards,
Nithin

2 Likes

Perfect Bro,

it works very well
I will test this in my overall process and keep you posted on Monday
Thank you so much

1 Like

HI @Nithin_P

Are you here?

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