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.
Solved! Go to Solution.
@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.
could you please show me it as in the workflow? should I use the field sort after directory?
@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
what should I write in file specification in directory field?
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
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!