THE INFORMATION IN THIS ARTICLE APPLIES TO:
- EFT Server (All Versions)
QUESTION
How can I configure an Event Rule to copy/move a file that is triggered on a Folder Monitor event with a Renamed condition?
ANSWER
Use the variable %FS.DST_PATH% instead of %FS.PATH%, and %FS.DST_FILE_NAME% instead of %FS.FILE_NAME%.
If the file is renamed, the new name context is lost to FS.PATH and FS.FILE_NAME, which still retain the old path/name, while the new path/name is passed to %FS.DST_PATH% and %FS.DST_FILE_NAME%.
EXAMPLE
Desired logic:
Monitor Folder()
if File Change = Renamed Then
Move renamed file to xyz location
Suppose the monitored folder contained a file called Robert.txt and I rename the file Bob.txt:
%FS.DST_FILE_NAME%
contains the new value Bob.txt, while
%FS.FILE_NAME%
contains the old value Robert.txt.
If you want to move the modified (renamed) file, use the "DST"-based context variables as shown below, as those contain the modified values.