Filtering the datatable based on two or more condition

I am using data scrapping to scrape a table from web , then i am using select method to filter the data table based on some condition
dt_WorkItems.Select(“Description=‘Generate Yearly Report for Vendor’ and Type=‘WI4’”)
i want to write this data in excel file so i am storing the above condition in a variable of type system.data.datarow. Then i am using for each loop to write data in excel .
I am not getting desired result.
Process.xaml (19.2 KB)
Please help me through this.

Based on your process, any reason why you assign WIID in for each body? I believe you can just remove the outer foreach (datatable), and straight away assign WIID from your select statement.

Hi @ig250097,

i saw your xaml file.inside for each you used write range activity instead that directly assign to Datatable

in write range directly pass the below query
dt_WorkItems.Select("Type='WI4' and Description='Generate Yearly Report for Vendor'").CopyToDataTable()

Regards,
Arivu

I still not getting desired result may be something is again wrong can you make changes in workflow and send me correct file. Thanks in advance.

Hi @ig250097
as @arivu96 mentioned you can write directly into the excel without a for each loop once you use .CopyToDataTable() here is a xaml to illustrate this, enjoy :wink:

Process.xaml (17.9 KB)

I also added append range activity instead of write range.
Hope it helps.

The workflow you send did not write anything in excel file.

Can someone please help me here.

Workflow seems okay, please see that there is some data in WID datatable

Thanks,
Prankur