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

Performance issue running multiple condition loops - how can I improve it?

Please see this image for screenshots of the flow

 

I have a Microsoft Form with statements which have Strongly Agree / Agree ... etc

 

I have around 60 questions. Each question needs to have a score. Eg. Strongly Agreee = 5

 

I initiated ~60 variables to hold the "score" of each question.

 

Using a condition loop to see if the response == Strongly Agree set the score to 5

 

The output is then added to a row in Excel.

 

When running the flow it's taking ~8 minutes.

 

How could I improve the performance of this please? Can it be done with an array? 

 

Many thanks for your support

M

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Regular Visitor

Re: Performance issue running multiple condition loops - how can I improve it?

I can access the value without brackets by using;

 

variables('answerArray')[0]

 

Increasing the value from zero as required

View solution in original post

6 REPLIES 6
Highlighted
Super User III
Super User III

Re: Performance issue running multiple condition loops - how can I improve it?

Hello,
2 things:
1) If this is a apply to each loop click the 3 dots on the loop and go into settings. Turn on concurrent/degree of parallelism. Set the number from the slider up.
*note that depending on how many times the flow is run, you could reach your maximum calls very quickly. *

2) you could have actions run parallel to each other. To do this click the + button to add a new action, but choose parallel action instead. You can drag other actions you have defined already and can have multiple parallel actions. I always do this when I can to help performance.

Hope this helps!

-Josh

If my post was useful please consider liking my post. If my post solves your issue please mark my post as a solution to help others. Thanks.




Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




Highlighted
Regular Visitor

Re: Performance issue running multiple condition loops - how can I improve it?

Thanks Josh - but did you see the first screenshot I posted? 

 

I attempted to build an array of the questions & therefore an array of the answers but it's not quite working as I expected.

 

When running a test it's building the question array as "Strongly AgreeAgree" ? Would expect the "current item" to just be "Strongly Agree" for the first question.

Highlighted
Regular Visitor

Re: Performance issue running multiple condition loops - how can I improve it?

I have updated it & the loop now works as expected

 

I now have an "answerArray" with the correct scores.

 

But how can I access the values of the array to insert a row into an Excel?

 

Thanks

Highlighted
Regular Visitor

Re: Performance issue running multiple condition loops - how can I improve it?

I seem to be able to access it using;

 

take(variables('answerArray'),1)
 

But it includes the brackets - eg. [5]

 

Any suggestions please? 

Highlighted
Regular Visitor

Re: Performance issue running multiple condition loops - how can I improve it?

I can access the value without brackets by using;

 

variables('answerArray')[0]

 

Increasing the value from zero as required

View solution in original post

Highlighted
Community Support
Community Support

Re: Performance issue running multiple condition loops - how can I improve it?

 

Hi @Mld9 ,

 

We can use the index directly to get the element value in the array variable.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (5,896)