cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dorinda
Impactful Individual
Impactful Individual

Looping in Apply to Each

I have a workflow that works perfectly creates the records in PDF and does what it is supposed to do but Fails every time because it is looping and see that the record is already created.

Dorinda_0-1640880104964.png

 

How can I make it so when I click the button in the PowerApp it just tries to run the one request.  I have everything in an applied to each because of the two append variables.


I am up for any suggestion.  In the first Compose it is pulling the email address of the one record I am requesting so I am assuming I can simplify this process.  Just not sure how or where to change it.

 

Thanks in advance.

11 REPLIES 11
DeepakS
Super User
Super User

Hi Dorinda,

 

You can avoid the loop , if you use following expression wherever you are referring to "Get Items -Load Chair" action:

 
first(outputs('Get Items -Load Chair')?['body/value'])?['<Column Name>']
 
Above expression will give you single result so you can delete the loop and use this expression in action/steps.
 
Regards.
Dorinda
Impactful Individual
Impactful Individual

@DeepakS 

I am not sure exactly what you are referring to.

 

What am I changing?

 

Dorinda_0-1640884962706.png

 

bkk
Helper I
Helper I

HI Dorinda, 

You wouldn't change Get Items-Load Chair. Instead use what Deepak has indicated where you want to get the data from Load Chair List. Example: Award Summary (I am assuming, Award Summary is a column in Load Chair List). 

Hope this helps

 

Dorinda
Impactful Individual
Impactful Individual

@bkk Thanks for confirming I just dont know how to use it, where do i put it?  In a compose in a variable.

 

I need more guidence.

Dorinda
Impactful Individual
Impactful Individual

@WarrenBelz Wondering if you have a solution for this one, since you have been so helpful with all of my other issues?

Hi @Dorinda ,

Sorry, I am not a Flow guru (just write what I need) and have not really needed to structure you have.

Dorinda
Impactful Individual
Impactful Individual

Was worth a shot, still stuck on this one

Dorinda
Impactful Individual
Impactful Individual

Can anyone help me get this resolved?

 

@RandyHayes any suggestions?

RandyHayes
Super User
Super User

@Dorinda 

The suggestion by @DeepakS and the follow-on by @bkk should provide what you need.

Where did you get on that?  If you've not applied that suggestion, then do so and see if that resolves your issue.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
Dorinda
Impactful Individual
Impactful Individual

Thats the problem I do not know how to apply that suggestion. This is the issue, is it a compose, variable or something different.  I am not a Power Automate person so I am struggling.

RandyHayes
Super User
Super User

@Dorinda 

What is being suggested is to get rid of the Apply to Each and move the action blocks that are in it, out of it.  Then change the input to the formula provided by @DeepakS so that it only works with one record and not all of them from the Get-Items.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

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

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (2,550)