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!

Alteryx Designer Desktop Discussions

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

New folder in Temp

mike_weaver
8 - Asteroid

Hi, everyone.

 

Is it possible to write a directory to the %TEMP% directory? If so, would I have to use a command in the run command tool (like powershell mkdir) or is there a way to create it with just Alteryx tools?

 

Thanks.

9 REPLIES 9
AkimasaKajitani
17 - Castor
17 - Castor

Hi @mike_weaver ,

 

In this case, you have to use Run command tool or Python tool or R tool to make any directories.

Other Alteryx tool can not make any directories.

 

Please find the Run Command tool sample.

AkimasaKajitani_0-1637636368624.png

 

Tanai_Goncalves
8 - Asteroid

Hey  @mike_weaver ,

 

As  @AkimasaKajitani  mentioned, that are lot of ways to do this.

 

For me, a good workaround is the Run Command tool, treated as batch macro, with a simple .bat file with the mkdir command, so you can create as many directory as you want, dynamically depending on your configurations.

 

Follow the steps:

 

Input something > Create a formula with the tempfilepath > dynamic rename newdir > send to the batch macro >  the batch macro will replace the directory to be created on the .bat file > newdir created

 

Note: the batch macro treat each record of input at a time, so be careful.

 

Please find the package attached and let me know if it worked.

 

Kind Regards,

 

Tanai

mike_weaver
8 - Asteroid

Thank you both!

mike_weaver
8 - Asteroid

I have a new wrinkle. I was successfully able to create a folder in the temp folder, however when I try to output to the temp folder, I am getting an error message that the output tool can't access the new folder in temp. Is it a permission thing?

Tanai_Goncalves
8 - Asteroid

not sure, but you need to be careful with the timing of processes.

 

Do you used the "block untill done" tool between creating the temp folder and writing to this folder?

 

Maybe your process is trying to reach that folder before being created.

mike_weaver
8 - Asteroid

Yes, I put up a block until done in front of the run command. Output 1 goes to run command, Output 2 goes to the rest of the app.

mike_weaver
8 - Asteroid

It's working now. Previously I had an action tool updating the output path of the file on the output tool, but i moved the naming to a formula and the action tool is updating that formula. That worked. Don't know why the other didn't.

Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @mike_weaver,

 

Glad to hear you've solved it! Can you attach your previous version? It would be good to determine whether it can be solved or there's a bug sitting somewhere!

 

Kind regards,

Jonathan

mike_weaver
8 - Asteroid

Hi, @Jonathan-Sherman, I can't really load either versions because they are very complicated and packaging it would be a pain. But here's what I think is happening.

I'm creating a macro that builds the subfolders based on a value in the data, then outputs some files to them, then runs a powershell script in those subfolders. When I was setting the output path in the output tool to a subfolder, the main app will try to verify the macro and find that the output path can't be found (because it hasn't been created yet). But when I set the output path to the subfolder in a formula tool and have the output path something that exists, then I can update the output path by the field created in the formula without breaking validation. So everything is happy and it runs.

Labels