Filter datable with column value based on few conditions

I have to filter datatable dt1 which has Column name as ‘name’ ex :compass accident employee
I have to filter products which has name containing accident as coverage and employee as claimant

@sheetal_Bora

Welcome to our UiPath community.

Try below select Query to filter DataTable.

    outputDT = dt1.Select("accident = 'coverage' AND employee = 'claimant'").CopyToDataTable

Hi @sheetal_Bora

Can you be more brief on the above?

Regards

From above datable obtain the value from column -name which has or contains accident and employee these two words based on inputs

Hi @sheetal_Bora,

I couldn’t understand your query properly but based upon how much I understood I hope the below code will give you the required output

var_DataTable.Select.Where(function(dr) dr(“Name”).ToString.ToLower.Contains(“accident”) And dr(“Name”).ToString.ToLower.Contains(“employee”)).CopyToDataTable


How to declare n fix this error

Thanks this worked for me @Mohsin_Inamdar

Great …!

If its worked for you please mark it as a solution

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