Veryfing if a file was added to folder

Hello guys!

Do you have any ideas if this is possible?

I will start off with a fact that I’m using StudioX.

OK so:

It it possible to verify at runtime if a file was added to the certain folder for example in the last 10 seconds? I will not know the name of the file. It can be ANY file, all I need is information true/false if - activity actives and checkes if <10 seconds ago any file was added to the folder and if yes it returns true if not it returns false

any ideas?

@anon40731888 yes it is possible we can check last updated file in folder through time

thanks, but any ideas how to bite this? file exists requires file name, I’m not sure how to start


This is how we do in Studio:

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

Just see if you can apply same logic, or concept to make this work in studio X.

You can also loop using For each File and Check Compare creation time of each file.




  1. Use the “Assign” activity to assign the current time minus 10 seconds to a variable. Let’s call it timeThreshold. The expression would be DateTime.Now.AddSeconds(-10).
  2. Use the “Assign” activity to assign the path of the folder you want to monitor to a variable. Let’s call it folderPath. Specify the folder path as a string.
  3. Use the “Directory.GetFiles” method in an “Invoke Code” activity to retrieve an array of file names within the specified folder. Use the following code snippet inside the “Invoke Code” activity:

vbCopy code

FilesArray = Directory.GetFiles(folderPath)
  1. Use the “For Each” activity to iterate through the array of file names obtained in the previous step. Set the variable type to String and name it filePath.
  2. Inside the “For Each” activity, use the “Get File Info” activity to get the creation time of each file. Set the “Path” property to filePath and assign the output to a variable, let’s call it fileCreationTime.
  3. Use the “If” activity to check if fileCreationTime is greater than timeThreshold. If it is, that means the file was created within the last 10 seconds. Set the condition to fileCreationTime > timeThreshold.
  4. If the condition is true, use the “Assign” activity to assign the value True to a boolean variable indicating that a file was added within the last 10 seconds. Let’s call it fileAddedRecently.
  5. After the “For Each” activity, you can use the fileAddedRecently variable as needed in your workflow.

Wait for Download may work for you.