Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

The highly anticipated Alteryx Community tradition is back! We hope you'll join us!

Learn More

Use Dynamic input to loop through CSV Files to import one at a time


I receive CSV Files once a day that I need to import into SQL Server.  However, since I currently have to manually run a script to convert the files from Excel to CSV I only do this process once a week which results in the files needing to be imported at the same time.  


I would like to import them dynamically one at a time.  So they would be run in the order that they are received.  Each file has the day it was created in it's file name.

IE:  100119.csv




I currently have a Directory tool pointing to this folder that grabs all of the csv names.  I feed it to a dynamic input tool that is currently pulling everything in.  However, it is doing it all at the same time.  Like the wildcard workflow.


Is there a way I can loop through this so it goes one at at a time?




 Yes, what you will need is to set up a macro with a control parameter that feeds the list of files in. This will run the tools inside the macro one time for every file that is passed through. 




Thanks for the reply. 


I haven't used these tools before do I need to do any special configuring on those two tools?  I've just connected the tools.



If you haven’t built a macro before it would probably be helpful to watch this video on building your first one:

You add the tools like you have done and then save it. This workflow will then be a macro which can be used in another workflow. The video above will explain this in more detail.