Why row is not there in context error coming when using group by function any one please help me

(from row in dt
group row by a= row(“PR”).tostring.Trim, b=Row(“ir”).tostring.trim into grp=group where grp.count=1
select grp.First
).copytodatatable

I wrote this query in dt_dt1 variable
but errors coming row is not there in context, group is not there etc
is there any package need to install to use group by functions

@Gangadhar_Athili @THIRU_NANI

for LINQ we dont have to add additional packages

we would recommend to add AsEnumerable to dt → dt.AsEnumerable

maybe you can share with us some sample data

also have a look here:
:ambulance: :sos: [FirstAid] Handling of The source contains no DataRows exception - News / Tutorials - UiPath Community Forum

[HowTo] LINQ (VB.Net) Learning Catalogue - Help / Something Else - UiPath Community Forum

share.xlsx (16.1 KB)

Hi,
Can u please help me
What I am trying to do is:
for same purchase req, same suppliercode same make poto either supplier or ts
the itemof requestions need to combine
and also for different one also need to add

please check excel file once
@ppr

is this topic a duplicate / same case of

?

PR IR SCODE MAKEPOTO
123 10,20 12356 supplier
123 30,40 22356 TS
12345 10 23456 SUPPLIER
12345 20 345 suPPLIER
12345 30 345 ts
PR IR SCODE MAKEPOTO
123 10 12356 supplier
123 20 12356 Supplier
123 30 22356 TS
123 40 22356 TS
12345 10 23456 SUPPLIER
12345 20 345 supplier
12345 30 345 ts

need if same suppliercode and same pr, same makepoto,then combine itemreq
if 1 of 3 is different then add that also in othersheet
@ppr

yes but I didn’t get solution facing some issues

we encountered that some flickerings within the requirements and sample data.
So we used following input:

to produce following output:

flow:

LINQ:

(From row In dtData1.AsEnumerable
Group row By a= row(“PR”).tostring.Trim, b=Row(“SCODE”).tostring.trim, c = row("MAKEPOTO").toString.Trim.ToUpper Into grp=Group 
Let jir = String.Join(",",grp.Select(Function (x) x("IR")))
Let ra = New Object() {a,jir,b,c}
Select r = dtResult.Rows.Add(ra)).CopyToDataTable

grafik

1 Like

can u share the xaml, I will keep as a reference if possible @ppr

refer to the screenshots more safe and faster.

Error ERROR Validation Error ) expected
; expected
Unexpected character ‘“’
Syntax error, ‘,’ expected
Unexpected character ‘”’
} expected
The name ‘From’ does not exist in the current context
The type or namespace name ‘row’ could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name ‘dt_data1’ could not be found (are you missing a using directive or an assembly reference?)
The name ‘a’ does not exist in the current context
The name ‘row’ does not exist in the current context
The name ‘Purchase’ does not exist in the current context
The name ‘Requisition’ does not exist in the current context
The name ‘b’ does not exist in the current context
The name ‘Row’ does not exist in the current context
The name ‘sode’ does not exist in the current context
The name ‘c’ does not exist in the current context
The type or namespace name ‘Into’ could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name ‘Let’ could not be found (are you missing a using directive or an assembly reference?)
Non-invocable member ‘Function’ cannot be used like a method.
The name ‘x’ does not exist in the current context
Using the generic type ‘New’ requires 1 type arguments
Non-invocable member ‘object’ cannot be used like a method.
‘Select’ is inaccessible due to its protection level
The name ‘CopyToDataTable’ does not exist in the current context
Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement comb.xaml

this type errors I was facing, any idea on this @ppr

just share a screenshot of your implementation and tell us if you have set the UiPath project to C# or VB.Net

Set as VB .net


@ppr

can you share your xaml?

tried to install system.data.dataset extension package but its failing to install, I am not sure, by this package I can solve issue, just tried

it looks like for any reasons your UiPath Project is set to C#
just check out the UiPath Project project.json

1 Like

yes great, the test xaml which I wrote is in C# only(sorry but my actual project is in vb.net)

tried in actual vb.net xaml, ohhh its working

really thank you @ppr

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