Filter ExcelData using ExcelData.Select - CopyToDataTable - need help

Assign FilterDT = ExcelData.Select("[DPE]=‘ “+DPEName+” ’").CopyToDataTable

I am trying the above the activity and to filter the Excel Data with DPE column.
I am taking that value from a variable DPEName, and its value is “John Mathew”.
When i execute the assign activity, getting error like below —

RemoteException wrapping System.Data.SyntaxErrorException: Syntax error: Missing operand after ‘John’ operator.
at System.Data.ExpressionParser.Parse()
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.VisualBasicValue1.Execute(CodeActivityContext context) at System.Activities.CodeActivity1.InternalExecuteInResolutionContext(CodeActivityContext context)
at System.Activities.Runtime.ActivityExecutor.ExecuteInResolutionContext[T](ActivityInstance parentInstance, Activity1 expressionActivity) at System.Activities.InArgument1.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, IDictionary2 argumentValueOverrides, Location resultLocation, Boolean isDynamicUpdate) at System.Activities.ActivityInstance.ResolveArguments(ActivityExecutor executor, IDictionary2 argumentValueOverrides, Location resultLocation, Int32 startIndex)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

Hi @Rinku_Mohanan ,

Is there any reason why you do not use Filter DataTable activity from Studio instead of writing Select query?

I have just tested your query and it is working when I wrote it manually like this:


Try to remove the spaces from the query and write it from scratch manually - do not copy and paste the query.

Let me know if that help. If not please send me the .xaml file so that I would be able to check your code :wink: