cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mld9
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
Mld9
Regular Visitor

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
MVP

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





Mld9
Regular Visitor

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
Regular Visitor

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
Regular Visitor

I seem to be able to access it using;

 

take(variables('answerArray'),1)
 

But it includes the brackets - eg. [5]

 

Any suggestions please? 

Mld9
Regular Visitor

I can access the value without brackets by using;

 

variables('answerArray')[0]

 

Increasing the value from zero as required

v-bacao-msft
Community Support
Community Support

 

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
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (2,616)