Error in reading column name of a csv file

This is the code “names.Select(”[Club Member]= ‘Yes’ “)” i have used to read a column here names is datatable variable and club member is Club Member is column name and is assigned to a dataRow variable named as club Members . Sequence throws an error unable to read column.

1 Like

@supu123 Helloo, can you provide a sample CSV?

1 Like

Below is the screenshot csv file.

Thanks and Regards,
Supriya

1 Like

Hi @supu123,

Your column name in the excel file doesn’t have a whitespace in between Club and Member. Please use "names.Select("ClubMember= ‘Yes’ “)” .
Regards,
Nimin

1 Like

@supu123, haha you made a mistake, try this instead:

“names.Select(”[ClubMember]= ‘Yes’ “)”

without the space for “ClubMember” :smiley:

Regards
Wilson Yan

1 Like

Below is attachment of command.


I also tried to read First and Last column in the cvs file but it is throwing same error for all 3 columns.

Thanks and Regards
Supriya

2 Likes

Please use
names.Select("ClubMember = 'Yes'")

Same way for other columns as well.

2 Likes

If none of the above is working for you, would it be possible to share the excel file you are trying to load to the workflow? So I can give a try on my side to see how it works for me.

1 Like

Below is the attachment of excel
Members1 Only.xlsx (9.6 KB)

Thanks and Regards
Supriya

1 Like

Hi @nadim.warsi
I tried the solution given by you but the sequence throws the same error.

Thanks and Regards,
Supriya

1 Like

I have used the same logic and it is working as expected.

I think you have unchecked the AddHeaders property in the excel read.

Note: You are reading a xlsx file and not actually a csv

1 Like

Hi@nadim.warsi
Can you please forward me the “xaml” file of the particular sequence and after debuggging I am getting a null value in it how to change it.

2 Likes

I see your ‘names’ datatable variable is also null.
Is your ReadRange working as expected?

ReadRangeFilter.xaml (9.2 KB)

Hi @supu123,

Check out the below xaml file which i created to extract data from the excel you shared. This worked fine for me.

ExcelClubMember.xaml (9.2 KB)

Hi @Lahiru.Fernando
I tried to run ExcelClubMember.xaml sequence sent by you.
In my pc as well as in my friends pc but its not working.
My pc output screenshot is attached below


My friend’s pc output screenshot is attached below
output screen reply

1 Like

Hi @supu123,

Sorry. May be because I sent only the xaml file. Attached below is the full solution folder. Try running this to see whether it works for you. You may need to change the excel file path in read range activity.

ExcelIssue.zip (18.0 KB)

Hi @Lahiru.Fernando

Thankyou so much it’s working now.But my query is “using ReadRange activity your sequence is able to read column but I was using read CSV and it wasn’t reading columnName so what is the difference between those.”

Thanks and Regards
Supriya

Hi @Lahiru.Fernando
It’s working with both CSV and xlsx file .can I know what were the errors in my sequence i.e where was I going wrong.

Thanks and Regards
Supriya

Hi @supu123,

There shouldn’t be much of a difference between the two. Read Range is used specifically for .xlsx files. Read CSV is used specifically to read data from a CSV file. But, still, even though its a csv file, still you can mention that it contains column names in the first row by selecting ‘IncludeColumnNames’ option in properties. if that option is not ticked, it will automatically give a default value to every column… something like ‘Column 1’, ‘Column 2’ etc.

May be that’s the issue you were facing… Does it help in answering your question?

Read CSV

Thanks
Lahiru

Hi @Lahiru.Fernando

‘IncludeColumnNames’ option is ticked in me but screenshot below displays that a null while is being provided to clubMembers how to change that