Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Create a folder where the workflow is saved

rybog98
6 - Meteoroid

Hi community,

 

I have a workflow that I plan to send to other people on my team. However, I do not want them to have to change the output file path on every file when they go to run it (There is at least 10). I want the files to be saved in a folder called "TABLES" that needs to be created in the same location where the workflow is saved. I know you can create a generic file path like so ".\Tables\File1.csv" and that will save how I want it to. Unfortunately this will fail if the folder "TABLES" hasn't been created. Any suggestions on how to check and create this folder if it doesn't exist or to allow the output tool to create the folder itself?

 

Thanks for the help!

5 REPLIES 5
patrick_digan
17 - Castor
17 - Castor

@rybog98 You could use an event that runs before the workflow like so. This would create the table folder before the workflow is run if it doesn't already exist. 

/cif not exist "Table\" mkdir Table

patrick_digan_0-1585764677343.png

 

rybog98
6 - Meteoroid

That worked perfectly! Thank you. @patrick_digan

JokeFun
8 - Asteroid

Hi @patrick_digan How to write the code if I need to create the folder somewhere else, i.e. not under the same folder as the current workflow?

Qiu
21 - Polaris
21 - Polaris

@JokeFun 
You can define the target folder as Working Directory

Capture1A.PNG

JokeFun
8 - Asteroid

Hi @Qiu ,

Thanks! This works!

Labels
Top Solution Authors