cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jeneaMD
Helper III
Helper III

Flow running slowly

Hello all,

 

I have a pretty complex Flow that is running correctly, but very slowly.


Purpose of the Flow: to check 170 rows (unique values) from an Excel worksheet in a document library where are 400 folders and if the unique keys from Excel are matching with the unique keys from the name of each folder -> then to update Excel row with the hyperlink of the corresponding folder if no -> to update Excel row with the text "Item not found" . The problem is that for doing these steps Flow needs about 2 days, that I consider is enormous:
1.JPG

 

Flow looks like below:

3.JPG

4.JPG5.JPG

6.JPG

 

Does anyone know how can I optimize the mechanics of the Flow, in order to reduce the running time?

Any help would be appreciated.

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions

Thank you, @efialttes for suggestions, but I think a found the appropriate solution.

I will switch to OneDrive instead of SharePoint, where I have the action "Find files in folder":

 

Capture.JPG

 

 

Instead of comparing each row from Excel with each name of folder in SharePoint, "Find files in folder" action from OneDrive is considerably faster.

Thank you!

View solution in original post

9 REPLIES 9
efialttes
Super User
Super User

Hi!

Flows with nested Apply to Each's + Condition inside indeed have a poor performance.

I would replace 'Apply to Each 2' and use 'Filter Array' instead. After 'Filter array' you can add a Condition to evaluate if nr of matches is greater than 0 by using the following expression:

 

 

length(body('Filter_array'))

 

 

Then on the true branch of this condition you can apply your logic (Get folder metadata etc), also on the false branch (Update a row 2 etc)

 

You can also consider to activate 'Apply to each' paralel execution

https://powerusers.microsoft.com/t5/Power-Automate-Community-Blog/Degree-of-Parallelism-in-Power-Aut...

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



rsaikrishna
Dual Super User
Dual Super User

Also, make sure the document library columns are Indexed Columns if they are used in Queries from PowerAutomate actions.

 

Hi @efialttes,

If you mean like this:

3.JPG4.JPG5.JPG

 

Unfortunately, it does not bring any modifications in running time.

Or I understood something wrong?

Thank you @rsaikrishna.


I have 4 columns all of them where indexed by me some hours ago and still no changes:

 

2.JPG

Hi!
I am afraid I shoud be more precise in my initial suggestion:
"I would replace 'Apply to Each 2' and use 'Filter Array' instead. After 'Filter array' you can add a Condition..."
You should assign the same input to your Filter array than the one currently assigned to 'Apply to each 2'. And remove 'Apply to each 2' also.
It will probably take you some time to convince Flow editor.
Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Thank you, @efialttes.

 

For me, it will be nice to have it now, but as I understood in this moment it's not possible to make my Flow faster.

Wai, wait, wait

An alternate easy approach to test

Did you tried to activate 'Concurrency' in your first 'Apply to each'? JUst give it a shot to see if iperformance gets improved

https://powerusers.microsoft.com/t5/Power-Automate-Community-Blog/Degree-of-Parallelism-in-Power-Aut...

The 'Filter array' approach is a bit complex to implement since Flow Editor with try to add an extra 'Apply to each'

Thanx!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Thank you, @efialttes for suggestions, but I think a found the appropriate solution.

I will switch to OneDrive instead of SharePoint, where I have the action "Find files in folder":

 

Capture.JPG

 

 

Instead of comparing each row from Excel with each name of folder in SharePoint, "Find files in folder" action from OneDrive is considerably faster.

Thank you!

View solution in original post

Wow.... Great job, @jeneaMD ! And, thanx for sharing!

I am sure other community members facing this issue in the future will find your solution so clever and so useful, the first one  me!

You guys make this community great!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,227)