Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Output Tool - Dynamic Naming - Extension to Folders?

peterr_h
8 - Asteroid

Hi!

 

(Edit: I've attached a very basic example workflow to show my method, the output that works, and the output that I'm trying to get to work).

 

I'm working on implementing a workflow for a client that will be run monthly as a report, though the workflow could require being run several times with tweaks to the input data between runs. There are multiple output files (these are required in separate files, not just separate sheets of a workbook), and I currently have dynamic logic in place to rename the output files with a DateTime variable created when running the workflow.

 

This currently creates a set of e.g. five (5) output files, named with a similar convention to:  yyyy-MM-dd_hh-mm-ss_{outputfilename}.xslx

 

The method that I've used to get the DateTime prefix is by creating a field, [DateTime], which is then appended to each output prior to output, I then use a formula tool to rename this with a filepath (i.e. ".\" + [DateTime] + "_{outputfilename}.xslx|||Sheet1") and then select the correct option in the Output tool to rename the entire filepath.

 

Due to running multiple iterations prior to having a final version, the folder can get rather clogged with 40+ output files very quickly.

 

My question is (thanks for bearing with), is there any way of using the same method as above but creating a new folder with the [DateTime] variable as its name? i.e., using a Formula tool with the following: ".\" + [DateTime] + "\" + [DateTime] + "_{outputfilename}.xslx|||Sheet1"? I have tried this and it hasn't worked, and I'm not sure if Alteryx actually has the ability to create folders?

 

If there is a way of doing this, I'd be extremely grateful for pointers! I can provide a dummy workflow to show what I mean above if my explanation is unclear.

 

Cheers!

4 REPLIES 4
JosephSerpis
17 - Castor
17 - Castor

Hi @peterr_h you can use the run command tool to create a folder dynamically based on the date. There are multiple posts on the community that showcase but here is one you can review.

peterr_h
8 - Asteroid

Thanks so much for pointing me in that direction Joseph - perfectly answers what I need! 😁

peterr_h
8 - Asteroid

Hi Joseph,

 

Apologies - back again with this!

 

Firstly, thanks for the link given - I was able to make folders with filepaths which was super helpful!

 

However, given the nature of the workflows that I'm working on, multiple people may need to run this and have their files/drives mapped differently to myself. I was wondering whether this method could create files with relative filepaths? I'm not a whizz at the Command Prompt, so I don't know if that's even possible. I'm assuming that it's not, but worth a shot!

 

Hope that makes sense, and thanks in advance!

Christina_H
14 - Magnetar

I don't know if you can use relative references directly in the Run Command tool, but you can in formula tools.  Use the [Engine.WorkflowDirectory] variable instead of '.'

Labels
Top Solution Authors