This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I have an issue with running the workflow if a file does not exists in the directory. I have the following set up:
- Around 25 txt files are separately imported via the 'Input Data' tool
- All of them are running through an unique workflow and are not dependent on each other
- After running the workflow the results are combined and outputed via the 'render tool' into one excel file with several tables and sheets
However, if one file out of the 25 doesn't exist in the directory, the output excel file will not be generated.
How can I check if the file exists in the directory and if it doesn't return some kind of value, so the output file will be generated even if the file is missing? In that case I would like to write something like: "File not in directory. Calculation not possible" in the specific cell designated for the result from the missing file.
I hope you can help me out ASAP as I could not find any other solution elsewhere.
What exactly defines when the you want the error message generated? You mention "around" 25 files, and if it is exactly 25 files, then you could use a directory tool, then count number of records and lastly have a message tool to throw you an error if the count is below 25. If this is the the case I'll gladly send over a workflow as example.
thanks for the quick response and your proposed solution. The problem is here, that the results of the single workflows, where the input files are running through, are joined by an 'Union' tool at the end and exported to a single excel file (In between there are several workflows which are changing the headers based on a config file, filled out by the user; making calculation based on input etc.).
The aim is that the output file will be generated in the same structure no matter how many files or which files are missing in the directory (this should happen after changing headers and before making calculations). So, if a file is missing, a string should be generated which says: "No data available". That way the output file be generated and the structure stays the same. Could be a macro more helpful?
The project I'm currently working on has already around 1500 tool IDs. If it is helpful I could prepare a simplified Alteryx xymd file to show you the project. However, this takes a couple hours :)
my problem was that the workflow did not create the excel file (via Render tool) when one ore more files are missing.
I made a workaround by creating a macro, which is checking in the directory if all files, needed for the main workflow, are in the folder. If not, the workflow creates the missing files. After that I run my regular workflow.