tww
(tww)
1
Hi all,
I am new to UiPath Studio X. So I tried to use the following code to get the latest file from a folder.
System.IO.Directory.GetFiles(<[str_FolderPath]>,“.”,SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime.ToList(0)
However, when I tried to run the activities, it only showed the code instead of the actual file name.
Any help is appreciated.
TWW
lrtetala
(Lakshman Reddy)
2
Hi @tww
Click on Open in expression editor and give your expression in that
System.IO.Directory.GetFiles(Str_FolderPath, ".", SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime).First()
Regards,
1 Like
Anil_G
(Anil Gorthi)
3
@tww
What is the type of ienum_latestfile
Also looks like it is string type and you would have given it as string
Just open advanced editor and paste the formula properly
Cheers
1 Like
system
(system)
Closed
5
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.