CSV file DataTable row filtering question

Hello, there,

I used a “Read CSV” to read a csv file, which contains a column of “Club Member” with values of “Yes” or “No”. Then I tried to filter (Assign activity) this csv file with:
names.Select("[Club Member]= ‘Yes’ ")**
I hope a DataTable with rows of “Club Member” = “Yes” will be created.

However, I got below exception: Cannot find column [‘Yes’].

“Yes” is a value of that column. How is ‘Yes’ treated as a column ?

Thanks

19.9.2+Branch.master.Sha.0928919eb1def274fdabeb0849d03a125c50fe6a

Source: Assign

Message: Cannot find column [‘Yes’].

Exception Type: System.Data.EvaluateException

RemoteException wrapping System.Data.EvaluateException: Cannot find column [‘Yes’].
at System.Data.NameNode.Bind(DataTable table, List 1 list) at System.Data.BinaryNode.Bind(DataTable table, List 1 list)
at System.Data.DataExpression.Bind(DataTable table)
at System.Data.DataExpression…ctor(DataTable table, String expression, Type type)
at System.Data.DataTable.Select(String filterExpression)
at lambda_method(Closure , ActivityContext )
at Microsoft.VisualBasic.Activities.VisualBasicValue 1.Execute(CodeActivityContext context) at System.Activities.CodeActivity 1.InternalExecuteInResolutionContext(CodeActivityContext context)
at System.Activities.Runtime.ActivityExecutor.ExecuteInResolutionContext[T](ActivityInstance parentInstance, Activity 1 expressionActivity) at System.Activities.InArgument 1.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance activityInstance, ActivityExecutor executor)
at System.Activities.RuntimeArgument.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance targetActivityInstance, ActivityExecutor executor, Object argumentValueOverride, Location resultLocation, Boolean skipFastPath)
at System.Activities.ActivityInstance.InternalTryPopulateArgumentValueOrScheduleExpression(RuntimeArgument argument, Int32 nextArgumentIndex, ActivityExecutor executor, IDictionary 2 argumentValueOverrides, Location resultLocation, Boolean isDynamicUpdate) at System.Activities.ActivityInstance.ResolveArguments(ActivityExecutor executor, IDictionary 2 argumentValueOverrides, Location resultLocation, Int32 startIndex)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

@dkang

Could you please show me the screenshot of your expression and need to check how you write it. And also have you checked Add Headers option in Read CSV file activity or not ?

Thanks for your reply. I did not see the “Add Headers” properties but did select “include column” option.

!

1 Like

The assign expression is:
names.Select("[Club Member] = ‘Yes’")

@dkang

Sorrry. It’s Include Column.

Could you please show me screenshot of your CSV data file.

Thank you, I found the issue. I checked my project file (rather than what displayed on Studio, the ‘Yes’ in project file is weird characters, which caused the problem. So I fixed it inside the project file. BTW, here is the csv file:
image First Last Club Member
Jay Gavin Yes
Zachary Craig No
Sherry Hooks Yes
Marcella Knipp Yes
Melvin White No
Nancy Fox Yes
Kristina Turner No
Craig Saucier No
Raymond Wilson No
Kent Danley No