How to get the wrong records?

Hi everyone!

I have 49k rows in my real excel but this excel is example for here.
I have to find wrong records in Fatura ID(“Export Exceli”) column which equals #N/A. Ater that, I should send wrong records to my manager.
How to get them to another excel sheet and send it?

image

@ozgecatak
Read the excel using Read range with headders

Then use Filter datatable to filter with your condition

HI @ozgecatak

You can use filter datatable activity and pass the condition like
image

Give the column name as “Fatura ID(”“Export Exceli”“)” if failed use the index

after that write the filtered datatable in the new excel or sheet and send mail to your manager

Regards
Sudharsan

@ozgecatak ,

output datatable variable from the filter condition will have the filtered values , then to share it through email, you can save that data table as an excel file using “Write Range Activity” and use the saved file path as attachment for the “Sent Mail Activity”

I couldnt work. When I applied it, it gives me all datatable again.
When it read range excel, I checked the values. I find this:

image

@ozgecatak ,
Can you try giving “contains” instead of = sign?

It didnt work.

@ozgecatak ,
Can you show me your filter condition (Screenshot)?

image

This is my input excel, after read range

HI @ozgecatak

How about this LINQ expression?

(From d In DtRead.AsEnumerable
Let cols = New String(){"Fatura ID(Export Exceli)"}
Where cols.Any(Function (c) d(c).ToString.ToUpper.Trim.Equals(" #N/A"))
Select r = d).CopyToDataTable

Regards
Gokul

Alternative Method @ozgecatak

Dt.AsEnumerable.Where(Function(r) r("PRDDATE").ToString)="#N/A" ).CopyToDataTable

Regards
Gokul

I dont understand this Linq, can you explain it?

@ozgecatak ,
Can you just verify whether the value is coming as #NA in the input datatable while reading,

I guess it will come as empty filed , if it is empty you can change the condition as “Is empty”

image

It doesnt work. :frowning:

@ozgecatak ,

Can you print the datatable in a message box by converting it to a string using(“Output datatable activity”)
and share its screenshot?

HI @ozgecatak

Check Out this XAML file

FilterUsingLinq.xaml (7.4 KB)

Regards
Gokul

Do one thing @ozgecatak

Read your excel and use a for each row in datatable inside that use a log message and write the values of that column and check how the value is appearing from the excel after few rows stop the process and copy that #N/A value in the output panel and then use that in the value field of filter datatable

Regards
Sudharsan

It comes {}

Have you got your Output Ah ? @ozgecatak