The parameter is incorrect


Could you please help me with this issue?

I have formula: String.Join(“”, Directory.GetFiles(filePathName,“*”,SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Take(1) )

I am using this formula in “Read CSV”

This formula worked on legacy, but for windows, it shows the error: “the parameter is incorrect”

Could you please help me with it? How can I resolve it?

Hi @Kamile_Petrucionyte

Can you share the error screenshot?

In my environment it does not show error


Hi @Kamile_Petrucionyte ,

Not really sure why the String.Join expression is used, we could also get the Latest file from the Folder/Sub Folders without the String.Join as well in the below way :

Directory.GetFiles(filePathName,"*",SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime).FirstOrDefault

Hello @Gokul001,

This formula was on “Read CSV”, So I change it and put in “Read CSV” my variable filePathName and it works now!

Thank you!

1 Like

Hello @supermanPunch,

Thank you very much for this information! I will use it!

1 Like

Great @Kamile_Petrucionyte

Kindly close this topic by mark as solved. It will help for other too


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