I have a workflow that intakes .csv files then processes and uploads the results to my DB. It renames the input files to avoid processing them repeatedly. The issue is that if there are no records (other than the header row) in one of the files, the InputData node does not populate the standard FileName variable. Without this value I'm not able to do the rename, and in most cases my workflow throws the slightly cryptic error "Failed to run external program "%temp%\FileRename.bat": %1 is not a valid Win32 application. (193)"
I have successfully added Count node and a Message node to post a message in this scenario. The problem here is that my workflow is set up to process multiple files, and the potential for throwing an error can adversely affect processing the other files' data. The real solution seems to be to make the FileName variable available from the InputData node whether or not the file has records. That way I can just rename the no-records file and be done with it.
Attached is my workflow and test files.
Steps to Replicate:
Thanks in advance for your help!
Maybe incorporating the directory tool can help? See attached, this gets both files renamed. I'm not sure if it would work in the larger workflow, but maybe this helps.
Hi @PaulFields2 ,
You can use the directory tool to accomplish what you want.
Regarding the upload to your DB, you can use a dynamic input tool to read the files.
The block until done tool is being used to order your process. Read and upload to your DB first and then rename your file.
Best,
Fernando Vizcaino
Thanks - would you mind including the workflow you've modified?
Thanks!
User | Count |
---|---|
19 | |
14 | |
13 | |
9 | |
8 |