web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Optimizing complex flow
Power Automate
Unanswered

Optimizing complex flow

(0) ShareShare
ReportReport
Posted on by

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?

 

overview1.png

ate1.png

ate2.png

 

Categories:
I have the same question (0)
  • VictorIvanidze Profile Picture
    13,073 on at
  • Community Power Platform Member Profile Picture
    on at

    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.

  • VictorIvanidze Profile Picture
    13,073 on at

    Radical way to speed it up is using MS GRAPH requests. But it will require a lot of work.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard