
Announcements
I built an app in Power Apps that uses a Flow as logic. This Flow connects to a server through FTP, looks for a given folder, and goes through this folder (3 levels deep) looking for files, gets the content of each file, and creates a copy in SharePoint. The Flow I'm using seems very inefficient, but I'm too new in Power Apps and Flow (and inexperienced in programming) to come up with a better solution. The first thing I tried was to simply copy the whole folder, which would be ideal, but the FTP connector doesn't seem to allow for this (If I run a "get content" action over a folder, it'll fail).
The Flow first lists the files in the FTP root folder and uses an Apply to Each to look for a given folder matching a string (passed through Power Apps). When found, it uses another Apply to Each to check if each item in this folder is also a folder, if it's not a folder it gets the content of the file and creates a copy in SharePoint, if it is a folder, it loops through it and repeats this same loop one more time on itself, looking for files.
This Flow can take north of a minute with 6+ files. Most of the time there are 5 files and it takes 30-60 seconds, but there can be 20 or more. I was wondering, is there a more efficient way to achieve this? I've been thinking about creating a Flow that only creates a SharePoint file (passing the id in the FTP server and the path in SharePoint) and have Power Apps run several instances of it in parallel (can that even be done?), but I just barely figured out how to pass an array from Flows to Power Apps and I don't know how to make power Apps run the same amount of Flow instances as there are projects.
Any suggestion is much appreciated.
Thanks.