Are you receiving the file through an FTP command used in VC or are you doing that separately?
- If you are using VC to download the file through FTP, you can have it only download files modified or created during a certain date range or within the last X minutes.
- If you set the Date filter for FTP and there are files that exist that meet your criteria, you can use that output as the attachment and the next step. ie. If no file, stop the job, if there is a file, email this attachment
If the answer to the question above is No and you have another process to receive the file, then a trigger on the folder would be sufficient. Set the trigger to start a task "Touch File" with the following settings:
Folder = {TRIGGER(ID|File.Result.Folder)}
File mask={TRIGGER(ID|File.Result.Name)}
(don't copy/paste these, you will need to find them in the Variables)
Under the Date tab- Set the Modified > {DATENOWADD(Minutes|-10|M/d/yyyy h:mm tt)}
(don't set the top one, that is Date Modified LESS THAN <)
Press Test to see the results
What this does is, after the task is triggered, it will look at the file that did the triggering and IF the date modified was in the last 10 minutes (that's the "-10" in the variable string above, pick your own if you want something different), then you will get an output for this task
NOW...Setup an email task AND a condition
The condition will be a VisualCron condition type where you pick the Specific Task from above (Touch File) and the Task Output is set to Contains: {TRIGGER(Active|LastTrigger|File.Result.Name)}
So. What you have done is allowed any file entering your folder X to trigger Task - Touch File, but the Output of that Task only exists IF the file meets the Date criteria (in my example, the file was modified less than 10 minutes prior) and if that condition is met, it will email someone. You could also add in a VC task to Stop the whole job once this is done and maybe tell it to start again later using Job Task Control
Sorry, that got to be a little long and is not that pretty but it will definitely work. Honestly, it is way easier to let VC go find the file on the FTP server and work with that output.
😄