It would be great if there was an option in the configuration of the Output Tool to create the output directory if it doesn't already exist. Maybe also to append instead of overwrite for all file types too?
An alternative solution would be to use the RunCommand tool to create the output directory before your output tool. A .bat file featuring the 'mkdir' command and the desired directory path as the command arguement can make this happen.
I've already set up a macro process to do this, I just thought it would make more sense if it was included in the native output tool.
I need this tool as well. I've created a batch macro to write a group of files to a specified folder, however I need to Alteryx to create subfolders under the user-specified folders. I've tried to use the Run Command to run a .bat file to create the folder, however my company IT group policy prevents me from running a .bat file, so I can't do it. Would be nice to just have a check box in the output file tool for "create folder if it doesn't exist." Looks like I'm manually creating a bunch of folders for the time being...
I want this feature as well. We automate a lot workflows in batch mode you can only "standardize" so much and I have many processes I have built were we do one-off runs for specific lists or subsets of data and we want to put these into folders recognizable, distinguishable, from the regular large data runs that may be in a standard folder with a time-stamp to differentiate one run from another.
We use parameters to pass in the subset list and other control parameters defining modifiable criteria. We could add a ticket number or project name to the parameter list and use it to define the output folder which ultimately may be a sub-folder to the regular report folder or a folder on the same level but since we don't know the ticket number or project name until it happens we can't set them up in advance and even if we did it would be a manual intervention required to an otherwise automated process.
If we could have either a MKDIR tool we could use before writing the output to it or an output tool that would have the option to create the folder if it does not exist, as I have seen in other tools, it would be awesome!
Another idea I will mention here but open a new thread on if I don't find one already out there is having the input tool have a feature you could select to test if the file is there and another to allow cause the workflow to pause for a definable period if the input file is locked by another user, then retry opening. The pause time-frame would be definable like for N seconds and the number of iterations it would cycle through should be definable so you can limit how many attempts to open a file it would try.
I have a few projects that would benefit from this as well. We have various processes where everything but the output directory is automated. Even my inputs are automated based on creation date. We are trying to replace tools that are being sunset and Alteryx has been able to replicate all but writing the new directory with a datetimetoday stamp.
This would help a lot.
(especially for us if it also works on HDFS)
This would be a very welcome addition.
I'm currently trying to use the batch file solution but, even though I use a Block Until Done tool, the directory isn't actually created until after I'm trying to write a file to it... resulting in "Error creating the file.... The system cannot find the path specified"
This is confirmed by spying the destination directory in File Manager.
Carl...this is a partial image of my workflow showing where I have the new directory created and when the new file is saved.
This runs perfectly for me every month.
carl_steinhilber
I have used this technique, building and running a batch file to create a directory, successfully in several flows I've productionized. I typically do use the "Block Until Done" tool to force execution order so the directory is made prior to it being needed.
Important to note the following:
If your flow does not use the "Run Command" tool the #1 above explains it.
If your flow uses the "Run Command" tool and works running manually but fails when in the Gallery then the caveat in #2 above explains it.
If your flow uses the "Run Command" tool and fails then there is probably
Feel free to sanitize your flow and attach it to a reply and I or someone else will look at it.
While I certainly appreciate all of the solutions presented here for a batch file workaround (I use the same myself), this feature should be baked into the product.Or at the very least give the user a checkbox option in the Output tool to create the folder if it does not already exist.
Please put this into the next version of Designer!
I would love something like this to be included in the output tool.
It would be even better to have a suite of tools that does file/folder management natively from designer