cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MDeguelle
Regular Visitor

Simple comparison takes multiple seconds

Hi,

 

I created a flow wich is triggert when as file is uploaded to Sharepoint.
Next a couple of conditions determine what to do with the file and the data in it.

First it checks the content-type, then the first line (column headers).

Both comparisons take 1 or more seconds, so far not a big deal, but then the flow starts ittarating all the lines in the file (about 5000 lines). On each row again a couple of comparisons take place like "is a column filled", "containes the colum a ; (multiple values)", etc. this to determine the values to use in a webservice. This webservice accepts a relative small amount of request per second / minute, so for now I limit the foreach to just 1 at a time.
All comparisons together take about 5 to 7 seconds for each line in the file. This way the flow runs a couple of hours, which is far to long especially knowing the most of this time is waiting for simple conditions like "[var] contains [char]"

setting the foreach to more then 1 could shorten the total time, but I can't get my head around a simple comparison has to take this long.

 

How can I speed up a comparison?

1 ACCEPTED SOLUTION

Accepted Solutions
eric-cheng
Solution Sage
Solution Sage

Hi @MDeguelle ,

 

Provided its not a latency issue and you cannot cut down the number of lines from 5000, you could look at enabling concurrency.  

 

ericcheng_0-1634213344685.png

 

Here are some articles that talks about it link and link.

 

One thing to be careful about is if you are setting variables in each loop.  When you enable concurrency, they all run in parallel so it is possible for variables to get mixed up.  The workaround is usually to replace variables with compose actions.  

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

View solution in original post

2 REPLIES 2
eric-cheng
Solution Sage
Solution Sage

Hi @MDeguelle ,

 

Provided its not a latency issue and you cannot cut down the number of lines from 5000, you could look at enabling concurrency.  

 

ericcheng_0-1634213344685.png

 

Here are some articles that talks about it link and link.

 

One thing to be careful about is if you are setting variables in each loop.  When you enable concurrency, they all run in parallel so it is possible for variables to get mixed up.  The workaround is usually to replace variables with compose actions.  

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

View solution in original post

Changing the concurrency did the trick, but indeed variables got mixed up.
I'm going to exchange the variables with compose actions as you suggest.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (3,365)