How to create a folder, if its not existing already
@vencric
Not sure it is really an alteryx question. 😂
Hi Qiu, Thanks for the solution,. I m facing below error
Also the folder will vary depending on the name, coming from formula tool dynamically
@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.
No.. Not running from remote location and also included %TEMP%
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
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)
Hi @Pravallika20 ... i faced error while runinng it... is it possible to create a folder in network drive