Lamba expression incorrect

I have this lambda expression:

diToProcessFolder=

diInputsProcessedFolder.FirstOrDefault(
Function(item) item.Name=argIn_strARAToProcessSubfolderName
)

I am getting this error:
image

Hi @E.T.S

diToProcessFolder = diInputsProcessedFolder.FirstOrDefault(
    Function(item) item.Name = argIn_strARAToProcessSubfolderName
)

After this expression is executed, diToProcessFolder will contain the first folder from diInputsProcessedFolder that has a name matching the value of argIn_strARAToProcessSubfolderName , or it will be Nothing if there’s no match. Make sure that the diInputsProcessedFolder collection contains the folders you want to search, and that argIn_strARAToProcessSubfolderName contains the name you’re looking for. Additionally, ensure that the comparison is case-sensitive if needed, as the comparison in your current code is case-sensitive.

Hope it helps!!

Hi,

Unfortunately I am getting the same error:

This is what I am trying to do:

We would recommend to check the following:

In general that Lambda is accepted:

But it could be the case that item is somewhere already defined e.g. a for each
So change to:

diInputsProcessedFolder.FirstOrDefault(Function(x) x.Name.Equals(argIn_strARAToProcessSubfolderName))

and try again

1 Like

Thank you very much!

Perfect, so it is working?
Forum FAQ - How to mark a post as a solution - News / Tutorials - UiPath Community Forum

Yep! Just marked post as solution :slight_smile:

1 Like

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