Find Most Recently Modified File In A Directory


#1

What is the use case

When making changes to a file that the business user also interacts with and updates, and these business changes must be replicated in further iterations of said file. Also to find a file name to refer to when the business creates a new file each time the report is created, for example. Making sure that all compiled data is up to date and referring to the most recent data in the most recent file.

How do you see a solution for the use case?

I have created a component which outputs both file name by itself (with extension) and also the full file path for use with excel scopes and move/copy file, for example.

Explorer - Get Most Recent File Name.xaml (21.0 KB)

Input arguments;

  • Folder for the robot to grab the latest file from
  • Optional ‘file name contains’ to specify a file name where multiple files are stored in one place
  • Optional extension to specify what type of file you are looking for

Output arguments;

  • The full file path including the directory of the latest file
  • The file name by itself (with the extension)
  • Success Boolean, if you require a check after the component has completed

Notes;

  • If the directory is provided in the argument without a backslash at the end, the component will add it on before proceeding
  • If the extension is provided without a . at the start, the component will add it on before proceeding
  • The component ignores any files with $ in the file name, which are temp files

Scope: Reusable Component


#2

This Idea is very good while implementing the OS related automation.

Please have a look of my ideas