Hello, Need support

i have completed an automation and tried to copy the project to another PC all is fine except of one sequence as shown.

i have changed nothing at all just copy and past. also this is the code inside the assigne activity.
(From r1 In GlobalVariablesNamespace.GlobalVariables.dtDataTable1.AsEnumerable()
Join r2 In GlobalVariablesNamespace.GlobalVariables.dtDataTable2.AsEnumerable()
On r1(“Company”).ToString() Equals r2(“Code”).ToString()
Select r2.Field(Of String)(“Company Name”)).FirstOrDefault()

the automation work normally at the first PC but once i copied it this is the problem.

Hi @mohamed.saty2012

Check the dependencies of the packages.
Make sure that the GlobalVariablesNamespace is avaiable in the imports panel,If not import it.

Hope it helps!!

is the studio version can be responsible for such error

@mohamed.saty2012,

Try typing this query instead of copy pasting. Sometimes UiPath Studio behaves weird.

(from r1 in GlobalVariablesNamespace.GlobalVariables.dtDataTable1.AsEnumerable()
  join r2 in GlobalVariablesNamespace.GlobalVariables.dtDataTable2.AsEnumerable()
  on r1.Field<string>("Company") equals r2.Field<string>("Code")
  select r2.Field<string>("Company Name")).FirstOrDefault()

I have just refactored your LINQ
Used Field<string> instead of r1("Company").ToString() and r2("Code").ToString() for better type safety and readability.

Thanks,
Ashok :slight_smile:

@mohamed.saty2012

Nope, have you checked with imports and dependencies.
Still you are facing
If yes,Remove the assign and give the activity again and try

@mohamed.saty2012

Hope it helps!!

Hi @mohamed.saty2012

Since you are using Studio X please remove the Assign acitivty and use Set Variable Value activity and retype the syntax. This should solve your error.

Regards

i have tried all the suggestion still have the same error

it doesn’t work. as you suggested

Hi @mohamed.saty2012

What is the error you are getting

Regards

the same as the screenshot
image

Can you try impoting the namesoace System.Linq from Imports Panel and retype the syntax @mohamed.saty2012

Regards

the data manager doesn’t show any data. its Blanck.

i have just updated the UiPath studio version from 23.4 to 24.4.0 and the problem has been fixed.

1 Like

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