Filtering Excel using Select method

Hi,

I have a sample excel file which I want to filter using the Select method. But, I am getting error. Attached required snapshots. Please help.

Annotation 2020-01-191 083624

1 Like

Are Both the ExcelDefaultData and eligibleExcelData are both of DataTable Types.


Mukesh

Hi
Kindly add this assembly reference to your main.xaml by opening that in notepad and then try mentioning copytodatatable once on opening studio

Also ensure that eligibleExcelData is variable of type System.Data.Datatable

Cheers @Saikat_Chowdhury

as i can see in your excel and workflow screenshots the column names are different.
@Saikat_Chowdhury

Kindly check whether the column names are matching in both workflow and excel.

For this, Instead of using .Select().CopyToDataTable and assigning it to new DataTable Variable use Filter Activity.

It is fair and simple.

FilterDataTable
FilterData

this is already present in the file.

1 Like

Awesome
Then is the eligibleExcelData is of type Datatable
Cheers @Saikat_Chowdhury

this I tried and worked. but I want to do using split method.

1 Like

Aaha I can see like the column name mentioned in filter is not correct
It should be Eligible for hike but was mentioned as “Eligibility for hike**
Kindly check that once

And if the assembly reference is mentioned in the xaml file then the expression be like
Datatable = Datatable.Select(“[yourcolumnname] = ‘yourvalue’ “).CopyToDatatable()

Cheers @Saikat_Chowdhury

1 Like

yes it is working now. It was my mistake that I misplaced the “[”. Thanks for the support!

1 Like

Cheers @Saikat_Chowdhury

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