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?
Have a look at this: https://powerusers.microsoft.com/t5/Using-Flows/Slow-running-of-Apply-to-each-only-joining-data/m-p/...
Does that actually work for file contents? Something like Select and using output from List files in onedrive? My e-mails are hardcoded in Send e-email, the issue is filtering and sorting .pdfs and .jpgs to the correct array and then sending an e-mail with that array.
Radical way to speed it up is using MS GRAPH requests. But it will require a lot of work.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
29 | |
28 | |
27 | |
20 | |
10 |