Alteryx Designer Desktop Discussions

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

Help: Using Run Command tool to create a folder

Eunice_97
5 - Atom

Hi all,

 

I have a workflow that gives me 3 excel file outputs at the end. When I run the workflow, I would like for it to automatically create a folder in a shared drive, with the folder named as "today's date" and have my 3 excel files saved in that folder

 

I heard that a run command tool can be used but I have absolutely no idea about the configurations. Does anyone know how to go about doing it / guiding me with the exact steps?

 

Also, a side question, is it possible to do this without a run command tool?

 

Thank you so much!

4 REPLIES 4
apathetichell
18 - Pollux

This thread (including the -p addition in the last post) walks you through the mkdir/alteryx interface and provides a batch macro in a workflow to show you how to implement...

 

I think the all important link didn't post so here it is again:

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/How-to-create-folders-and-output-excel...

Qiu
20 - Arcturus
20 - Arcturus

@Eunice_97 
Just a quick sample

Capture3A.PNG

LATHROPS
7 - Meteor

Just to add something, the -p does not work (or at least for me) in the Windows environment with mkdir or md.  Instead I used the following command: "if not exist ." +[DirName] + " mkdir ." + [DirName]

 

The periods are there because I want the folders created at one level above "_externals". 

 

Now just tweaking the workflow to guarantee the folders are created before the output tries to place files in them.

TheOC
15 - Aurora
15 - Aurora

hey,
Just to add - i released a free tool on the Alteryx Gallery for this job:
https://community.alteryx.com/t5/Public-Community-Gallery/Create-Folder-Path/ta-p/928839

This uses the run command similar to as discussed above. Feel free to open the macro and see how it works (I haven't locked/encrypted the macro, so if you just want the logic it may be useful). 

 

The logic is simple, an explained in the source above - i use a command to check if the folder path first exists, and if not, i use the mkdir command.

 

Hope this helps,
TheOC


Bulien
Labels