We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Automatically download files in the input

howyoudoing
8 - Asteroid

How to set the workflow to download the two newest files that are located in one folder as in the attachment? To not select the newest file in input manually every day, but to automatically select the two newest reports? (first - consolidated for a given month and the second - master with the date in name updated daily with more refreshed creation date? (both files are generated daily using macros) For today the example files will be the one marked in yellow.

6 REPLIES 6
OTrieger
14 - Magnetar

@howyoudoing 
Use Directory tool, then sort the data based on last updated, use sample tool to select the first 2 files and send it to a batch macro to open the files.

howyoudoing
8 - Asteroid

could you please show me it as in the workflow? should I use the field sort after directory?

alexnajm
18 - Pollux
18 - Pollux

@howyoudoing@OTrieger is being pretty clear about the order of tools and I would agree with the process. Please try it first and let us know if you run into issues

howyoudoing
8 - Asteroid

what should I write in file specification in directory field?

alexnajm
18 - Pollux
18 - Pollux

You don't have to write anything and it will read in all files - or you can be more specific (i.e. only .xlsx files would be *.xlsx)

https://help.alteryx.com/current/en/designer/tools/in-out-tools/directory-tool.html#idp331130

acotta17
7 - Meteor

Hi @howyoudoing,

 

Steps:

1. Use the directory tool to select the directory from which you want to get the files

2. Use the sort tool and sort on creation time - descending
3. Select the Sample tool with First N rows with N=2

4. Use the Dynamic Input Tool and select Full Path with action as Change Entire File Path

 

[Screenshot attached below]

 

Hope this helps!

image.png

Labels
Top Solution Authors