Code in Invoke Code Error is:
Dim objs As array = { _
New With { .Item=“A”, .Loc=“L1”, .Q1 = 1, .Q2=0}, _
New With { .Item=“A”, .Loc=“L1”, .Q1 = 2, .Q2=1}, _
New With { .Item=“B”, .Loc=“L1”, .Q1 = 3, .Q2=99}, _
New With { .Item=“B”, .Loc=“L2”, .Q1 = 7, .Q2=0} _
}
Dim Query As IEnumerable
query= From e In objs Group e By key= New With { key e.Item, key e.Loc } Into g=Group _
Select New With { _
.key = key.toString, _
.value = New With { _
.Q1 = g.sum(Function(x) x.Q1), _
.Q2 = g.sum(Function(x) x.Q2), _
.Count = g.Count _
} _
}
Any help,thanks a lot.
The thing is that UiPath Invoke code activities allow strict option. So, while developing the code in Visual studio, make sure that the first line of the code is
Option Strict On;
And coming to the point, As quoted, e and g are not recogning in the code.
Just hover on each variable you have in the line which is erroring out. If the variable is working fine, it will show the details and the type of the argument… If it is not, then it will throw the error.
For the above code, e and g are giving errors and you need to convert them to the required type using CType conversion available in VB