Hi guys,
Continuation of earlier problem... struggling to get this to work, think I've melted my brain so need some explanation on how to get this to work:
- Wait for files in folder - a csv file, the name will change but it will always be csv
- When files are seen, iterate through them and run sub flow to read them, take the variables and run a API call, followed by a SQL query
- When the API call and SQL query are complete, rename the file and move to folder
I've got this working perfectly so far, but this basically relies on the file name being the same every time and there's a chance that isn't going to happen, so I need to hedge my bets:

This works fine assuming the file name is always the same, but I don't want to run in to an issue where potentially DriverCard(1).csv (2) etc. appear and the flow not run.
I assume having the loop would cause some issue to the current flow, for example sake the SQL query looks like this:

I'm guessing the loop would mean it needs to start by looking at a variable?
My brain has melted at this stage so any help appreciated.