How to get a specific and most recent file from a directory


I am trying to get this most recent “List” file in this directory, and it appears that UiPath isn’t allowing wildcards in my file name.

Based on the screen print, I want to get THIS specific “list_p00028832vja_ *” I am unable to name a specific file because as you can see that last segment in the string is a date variable.


Can you try the below expression:

str_filepath = Directory.GetFiles(yourfolder_path,“list_p00028832vja_*”).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Tolist(0)

1 Like

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