cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mld9
Level: Powered On

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
Mld9
Level: Powered On

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
Jcook
Level 8

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.
Highlighted
Mld9
Level: Powered On

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.

Mld9
Level: Powered On

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

Mld9
Level: Powered On

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? 

Mld9
Level: Powered On

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

Community Support Team
Community Support Team

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
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,836)