Alteryx: Directory Tool & Dynamic Input

by John Power

The Directory Tool returns a list of files contained in a specified directory along with relevant file attributes.

The Dynamic Input reads and processes from any input files or databases. Aside from the example outlined below, the dynamic input tool is often used  to target and import the latest file added to a folder, or to import multiple sheets from one excel workbook.

If our files are all located within the same folder we can use the regular input tool.

Here, all 3 of our inputs are within the input data folder:

As there is nothing else in this folder, we can use the below configuration to pull through everything within this folder:

The asterisk is used as a wildcard and will allows us to pull through all files regardless of their titles.

But how can we import these same spreadsheets if they are all located in different files?

input 1 is now located in folder input data

input 2 is now located in folder input data 2

input 3 is now located in folder input data 3

All of these folders are still in the inputs folder saved on the desktop.

In this situation as long as all files have the same schema and are the same file type we would need to use the directory tool and the dynamic input tool.

First we will need to drag the directory tool onto view and configure it as so:

The directory is the pathway to the folder that we want to target. Here, as all of our 3 input folders are in the inputs folder we have selected that.

The file specification allows us to identify the folders that we need to pull through. As each of our required folders start with 'input' we can use this, followed by the asterisk (wildcard).

In this scenario we have ticked include subcategories, as we want to be able to pull the pathways for everything within out inputs folder (input 1, 2 and 3).

We now have our pathways:

Now we need to drag the dynamic input tool onto view and connect it to our workflow. We will configure it like:

Under edit, we just need to target one of our required folders. Ensure read a list of data sources is ticked, and update the field and action dropdowns as displayed.

Once we run the workflow, we can see that all of the data has been pulled in: