Code is working in Windows Legacy not in windows

Hi All,

I am trying to run a code of vLookup in UiPath (Windows), it is not working, (please find the attached screenshot of the error I’m getting


)but when I tried to run the same code in Windows-Legacy it worked fine. Can anyone please explain and tell me why this is happening? Also please can anyone explain what changes needs to be done in the Windows code so that I can make it work? Also please find attached both the codes one written in Windows and the other in Windows- Legacy.
vLookup.zip (10.1 KB)
vlookup_WindowsLegacy.zip (16.2 KB)

Thank you
Ashwini

Hi @ashwini_bagewadi ,

The source of error seems to be assign activity, can you display the expression in the assign activity?

Regards,

Thank you so much @vishal.kp for your response. Please find the attached screenshot
image
As your saying the assign activity may have an error but there is no error sign, and how come the same code is working in Windows-Legacy?

@ashwini_bagewadi , the double quotes you are using seems to be different. Can you replace them with " and try?

Regards,

I changed the double quotations. Still getting the same error.

Thank you

@ashwini_bagewadi ,

This works fine, tried in windows :

(From a In collectionsDT.AsEnumerable()
Group Join b In AgeingDT.AsEnumerable() 
On a("Bank Invoice") Equals b("Document Number") Into gj = Group
From g In gj.DefaultIfEmpty
Let slsa = If(isNothing(g), Nothing, g(1))
Let rapre = a.ItemArray.Take(2).Append(slsa)
Let rapost = a.ItemArray.Skip(3)
Let ra = rapre.Concat(rapost).toArray
Select r=dtResult.Rows.add(ra)).CopyToDataTable()

vLookup.zip (15.4 KB)

Regards,

1 Like

@ashwini_bagewadi , let us know if you are still facing the issue.

Regards,

Your code worked amazingly well (even in Windows). So I tried to compare the the code sent by you with my code, it is exactly same ( please let me know if I may have missed any minute details). So I typed the same code in Assign Activity instead of copy pasting it, this worked for me, I was able to run my code.

Please can you explain where I have gone wrong.
One thing you made clear that the issue was not Windows/ Windows-Legacy but the code.

On the other side it still remains unknown is that how did the code run fine in Windows- Legacy!

Thank you sooo much for your time and support. It is because of you guys that learners like me are able to find the answers. :smiley:

1 Like

@ashwini_bagewadi , glad that the solution helped.

The code was perfect, the issue was with the double quotes. This usually happens while copy pasting the code from external sources or opening the project in different mode. I had just edited the quotes rest everything was intact.

Regards,

okay, got it, Thank you :smiley:

1 Like

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