Alteryx Designer Desktop Discussions

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

Dynamic Directory to List Files

djodts
8 - Asteroid

Hello,

 

I am looking to create a process to check a folder and simply list the files in that particular folder.  I know how to do this with the standard directory tool, however the problem is that each time I run the workflow, I want the directory to be dynamic.  For example, I will want to point to say C:\user\09.  Next month, I will want to list the files in C:\user\10 and so on.  I know how to create a dynamic path...I just don't know how to feed that into a directory tool...since it doesn't accept an input.  The dynamic input tool would be great, except it seems to only accept filenames, not just the directory itself.  Please let me know of any thoughts.

 

In case this helps with other thoughts... the purpose of my workflow is to grab files from a server and move them based on certain criteria.  In the end, I want a list of the files that moved.  Of course, I can use the current workflow to simply list the files that met the criteria and were to be moved, but without actually checking the folder itself, I cannot confirm that the action was successful, thus the desire to actually look at the folder to create the list.

 

Thanks

4 REPLIES 4
BrandonB
Alteryx
Alteryx

You will want to make a macro that feeds in this dynamic path as a control parameter like so:

 

dynamic directory.png

CharlieS
17 - Castor
17 - Castor

Hi @djodts 

 

This can be done with an Analytic App. By Adding an action tool to update the filepath, a formula in an Action tool can update the Directory tool to the current month's folder. 

 

Here's a formula that will create the requested string for each month:

"C:\user\"+"\"+tostring(DateTimeFormat(DateTimeToday(),"%m"))

 

I've included an example of this in the App attached to this post. 

jhustin
7 - Meteor

I tried this but cannot get it to work. Even running the sample workflow, the action does not update the directory filepath. Am I missing a step?

melmarcos
5 - Atom

Hi,

 

The best workaround is to create a separate Macro as Brandon mentioned above.

Labels