ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

How to create a folder, if its not existing already

vencric
Asteroid

How to create a folder, if its not existing already

36 ANTWORTEN 36
Qiu
21 - Polaris
21 - Polaris

@vencric 
Not sure it is really an alteryx question. 😂

0302-vencric.PNG

vencric
Asteroid

Hi Qiu, Thanks for the solution,. I m facing below error 

vencric_0-1646201641976.png

 

vencric
Asteroid

Also the folder will vary depending on the name, coming from formula tool dynamically

Qiu
21 - Polaris
21 - Polaris

@vencric 
It did not happen to me as for the error, are running the flow from a remote location?
I am sure your have the %temp% as environment variable.
For the path, we can of course blend into the formula.

 

vencric
Asteroid

No.. Not running from remote location and also included %TEMP%

vencric
Asteroid

hi @Qiu , i am able to create folder in my local machine.... but when i'm trying to create in sharedrive, im getting this error

Pravallika20
Asteroid

Hi @vencric ,

 

You can drag a python tool and add the following Python code:

 

from ayx import Alteryx
from os import makedirs
from pandas import DataFrame
df=Alteryx.read("#1")
path=df["path"][0]

try:
makedirs(path)
except OSError:
message_log = {"MessageLog" : "Failed creation of the directory " + path,"FolderCreated" : 0,"Path":path}

else:
message_log = {
"MessageLog" : "Successfully created the directory: "+ path,"FolderCreated" : 1,"Path" :path}
output_df = DataFrame(message_log,index=[0])

Alteryx.write(output_df,1)

vencric
Asteroid

Hi @Pravallika20 ... i faced error while runinng it... is it possible to create a folder in network drive

Pravallika20
Asteroid

Hi @vencric ,

 

You can create the folder in network drive. Can u tell me the error u are facing

Beschriftungen
Top-Lösungs-Autoren