Datatable Activities - Group By - Syntax Error

Hi @balupad14

congratulations and thanks for your great activity packages. I am using Balareva.DataTable.Activities v2.0.2 with UIPath Studio Pro 2020.4.1 Community License Stable.

I have a bug to report in the Group By:

I have a datatable containing just one column of strings. I need to count the occurrences of the strings. I tried both Group By Aggregation and Native Group Aggregation, they work well in most cases. But in one particular case they fail: if the datatable contains string with apostrophes. For instance if the datatable contains the following three rows:

Piemonte
Valle D’Aosta
Lombardia

the group by fails and produces the following message: missing operand after ‘AOSTA’ operator.
If there are no such apostrophes in my datatable, everything works perfectly.
If it helps, here are the exception details for the Native Group Aggregation:

RemoteException wrapping System.Exception: VALLE D’AOSTA,
System.Data.SyntaxErrorException: Syntax error: Missing operand after ‘AOSTA’ operator.
at System.Data.ExpressionParser.Parse()
at System.Data.DataExpression…ctor(DataTable table,String expression,Type type)
at System.Data.Select…ctor(DataTable table,String filterExpression,String sort,DataViewRowState recordStates)
at System.Data.DataTable.Select(String filterExpression,String sort,DataViewRowState recordStates)
at System.Data.DataTable.Compute(String expression,String filter)
at DataTableExtensions.NativeGroupAggregation.GroupBy()
at DataTableExtensions.NativeGroupAggregation.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance,ActivityExecutor executor,BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor,BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor,BookmarkManager bookmarkManager,Location resultLocation)

Can you please offer a workaround and/or fix the issue? Thanks!

Stefano

1 Like

Hi @stefmorp

Can you share your query by using execute query

Thanks
Ashwin.S

Hi Ashwin,

thanks for your prompt reply. I have no query to show since I am using the Group By Aggregation activity in UIPath. However, if it helps, here is the picture of the Group By activity:

image

And here is a glimpse of the table TabellaNormalizzazioniMancate where the group by happens:

image

NomeColonnaDaNormalizzare contains REGIONE_ISTITUTO at the point of failure.

Hope it helps! Do not hesitate to ask for further details!

Ciao,
Stefano

1 Like

Hi @stefmorp

Check this

Group by Aggregation

Thanks
Ashwin.S

Thanks Ashwinsrini88,
for your continued help. Unfortunately your suggestion does not help me. My group by aggregation already works perfectly, so I don’t need help on the workflow. This is represented in the first example below. But it fails miserably if there is an apostrophe in the data, as in the second example. If I had access to the query, I would replace apostrophes with double apostrophes, but this is the Activity image and does not expose the underlying query. This can be fixed only by someone with access to the code of the activity. Can you or @balupad14 fix it please?

Thanks!
Stefano

1 Like

HI @stefmorp,

Welcome to UiPath Community !

Thank you very much for using the package and giving the feedbacak about it. Sure definitely, I will take look on this issue. And get back to you…

Thank you
Balamurugan.s

1 Like

Hi Balamurugan,
have you been able to make progress on this issue?
Thank you,
Stefano