Hi, I have built a flow that get files from a onedrive folder and then sends emails with those files as attachments. Depending on different keywords these files gets sent to different groups of people. I'm only about 25% done because there are hundreds of different combinations of files and each combination requires a unique setup of recipients and CC's.
The flow is structured as shown in the picturues:
1. Initialize variables for arrays (attachments)
2. List files
3. Apply to each (Get metadata, Get filecontent, Filter condition to only append specific files, Append to array, Move file to a "Sent"-folder)
4. Send E-mail.
Now there are alot of Apply to Each and they are starting to clog down the process. Can take between 30 - 50 mins in total. I tried concurrency setting but setting it to high results in errors. It skips files etc. But setting it on 1 makes it really slow.
Are there any ways to do this better? Maybe avoid Apply to each?


