Articles → UIPATH → Find The Latest Modified File In A Single Directory In Uipath
Find The Latest Modified File In A Single Directory In Uipath
Example
Click to Enlarge
- Drag and drop the "Assign" activity and assign the value to the string variable "MostRecentFile" to
(new DirectoryInfo("C:\temp\Articles")).GetFiles().OrderByDescending(function(x) x.LastWriteTimeUtc).FirstOrDefault().FullName
Click to Enlarge
- Display the value of the "MostRecentFile" variable in the message box
Click to Enlarge
- Save and run the bot
Output
Click to Enlarge