Description
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Notify Moderator
Creating folder structures is about the last thing left for Alteryx to automate... until now!
I've faced this issue a couple of times. I am trying to output to a location using this setting on an Output Data tool:
But the folder structure does not exist, and i receive the following error:
Now without some Alteryx Wizardry, I would need to manually create this folder path, before running the workflow again. This can be frustrating when uploading a workflow to the server, or receiving this error after running a long workflow.
What I have created, is a tool that ensures this path is created prior to outputting. Its as simple as adding the tool before the output:
And specifying the field that contains the folder path:
and hit run:
And you can see, it has successfully written a file to that location.
Do let me know if you run into any issues with the tool and I'll get them fixed as soon as I can.
Thanks,
TheOC
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Notify Moderator
I tried your tool this morning, I love the idea and hoping to make it work for me. Currently I am performing some analysis on journal entries and summarizing by company code outputting around 80 excel spreadsheets for management review. The workflow failed initially, I believe, due to tool 23 (regex) having a variable length of 27. I updated the length to 255 characters and the error from tool 23 disappeared, however, the workflow then errored because the file path & file were not created. I suspect it has to do with how the sheet name is specified ("path\filename.xlsx|||sheetname"), but that's my best guess. Any ideas?
Thanks!
Sam
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Notify Moderator
hey @LATHROPS
Sorry to hear about your issue, and great spot on the 27 variable length - i have fixed that now, and will reupload the tool as a new version.
Regarding the file path - I have tested it with a file path as: path\filename.xlsx|||sheetname, and it works fine on my machine. Within the Formula tool (Tool 26), it should have a new field 'New folder' which is the path of the folder without a file:
Are you able to test one of the file paths that did not create, by opening the macro (right click, open macro), and pasting one of them into the macro input of the tool after hitting 'Edit Data':
and then hit run inside the macro, just to see if that file path carries through the macro correctly. It should look similar to my first screenshot by the time it hits my create folder batch macro.
If you have no luck, I'm more than happy to jump on a call.
Thanks,
TheOC
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Notify Moderator
I ended up going with the Run command to generate all of my folders during a "workflow prep" stage. I suspect the errors I received from the macro were likely related to how I'd formatted the path for the file.
In other news, what led me to your macro was the dilemma around ensuring my folders existed prior to the workflow trying to place folders in the locations specified. I created my folder creation workflow in parallel to the journal entry analysis workflow. After sleeping on it, I solved my workflow execution sequence dilemma by joining my folder name input with a record ID, feeding the joined results to a select statement "command" field which writes to a ".bat" using the run statement. Between the select statement and the run statement I have a "Block until Done". I then used a Select record statement for the first record of the command line which appends to the original data set and is then fed back into my workflow (I deselect the command column later). I used the IF NOT EXIST <path> MKDIR <path> to deal with preexisting folders. It's not the most elegant, but it works!
I will likely use your macro again in future workflows, I suspect I messed up my file path. Well done!
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Notify Moderator
When I use the Macro, I failed to create all the folder, have 4 but only create 2.
But in the workflow, the output for Macro are integrity to 2669.
I don't know why it happened.