Free Trial

Alteryx Designer Desktop Discussions

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

Dynamic input tool

bmccarthy5
5 - Atom

I am trying to return the first 3 files from a folder based on descending order. I am having trouble bringing them in through the dynamic input tool. Right now I have the dynamic input tool reading the FullPath but unsure how to select an entire folder as the data source template rather than a specific sheet?

alteryx q.png

4 REPLIES 4
apathetichell
19 - Altair

Don't use Dynamic Input -> use a batch macro.... (or a series of batch macros). Dynamic Input has fairly specific limits.

Pilsner
11 - Bolide

Hello,

The dynamic input would work if all your tables have the same schema however a batch macro with a standard data input inside could be a better approach as it will handle tables with different schemas without erroring. Using a control parameter you can then overwrite the input file path. 

You will notice I also have a filter tool at the start of the workflow. This is simply to filter out the yxdb and yxmc files as I have them saved in the same folder.

 

Screenshot 2025-01-02 161024.png


Please find attached a folder with 4 excel documents I used as dummy data, a macro and a workflow.

 


Hope this helps with your problem, please let me know how you get on.

Regards - Pilsner

bmccarthy5
5 - Atom

Thanks for the help, I was able to build it out! So, using the macro, these files should update when new files are added to the folder, correct?

Pilsner
11 - Bolide

Glad to hear you've been able to make some progress. Yes that is correct, adding new files into the folder should be automatically updated upon the next run of the Alteryx workflow. Alternatively you could repoint the directory tool to a different folder containing all the files you want to input. 

Please note the filter tool currently filters to just excel files so you may need to change / remove this if you use different file types. 

 

As the example data I used was from excel files, the file path must contain a specific sheet ie. ".\Four.xlsx|||'Sheet1$'". In the batch macro, the action tool only overwrites the ".\Four.xlsx" part as the sheet name was the same on all my files. This means that all the different file paths get "|||'Sheet1$'" appended on the end. If you are referencing different file types (i.e not .xlsx) you will need to change the action tool within the batch macro to overwrite the full value ".\Four.xlsx|||'Sheet1$'".  

Screenshot 2025-01-02 221935.png


Please let me know how you get on.

Regards - Pilsner

 

Labels
Top Solution Authors