Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!
The Product Idea boards have gotten an update to better integrate them within our Product team's idea cycle! However this update does have a few unique behaviors, if you have any questions about them check out our FAQ.

Alteryx Designer Desktop Ideas

Share your Designer Desktop product ideas - we're listening!
Submitting an Idea?

Be sure to review our Idea Submission Guidelines for more information!

Submission Guidelines

Create Directory in Output Tool if it doesn't already exist

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?

13 Comments
CharlieS
17 - Castor
17 - Castor

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. 

Timur_O
8 - Asteroid

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.

BenG
Alteryx Alumni (Retired)
Status changed to: Under Review
 
nextelspe
7 - Meteor

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...

fharper
12 - Quasar

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.

 

 

mocalvo
7 - Meteor

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.

dataprep
8 - Asteroid

This would help a lot.

 

(especially for us if it also works on HDFS)

carl_steinhilber
8 - Asteroid

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.

mocalvo
7 - Meteor

flow.jpg



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.

fharper
12 - Quasar

 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:

  1. Use the "Run Command" tool to execute the batch that was dynamically generated.  IF you use an event you can only run it before the run or after the run.  Before the run you haven't been able to build the batch file, after the run you already tried to use the folder you intend to build.  So "Run Command" tool is a must.
  2. A caveat to this is that the "Run Command" tool is one of several tools prohibited in the Gallery.  So if you build it in a flow and test and all is well but then publish to a gallery then it will be disabled automatically, no warning, and thus the flow fails because that function was never run. 
    1. You can get an exemption but you can read up on that by going to help on the tool to see the procedure.

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

  1. a configuration problem in how you set up the "Run Command" tool.  It often confuses people a bit when they first try using it.
  2. You may not have the "Block Until Done" tool positioned well.

Feel free to sanitize your flow and attach it to a reply and I or someone else will look at it.