web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : dNzM6jNr/xYnwy0Nm9Dz3u
Power Automate - Building Flows
Answered

Removing apply to each

Like (1) ShareShare
ReportReport
Posted on 17 Dec 2021 20:01:33 by 2

I am new to Power Automate and I somehow created a nested Apply to Each action but i need to remove the upper 2 actions. I have tried to just drag the lowest one out but keep getting the error "This action cannot be dragged out of foreach as it depends on an action inside foreach." I need the "Apply to each 5" to be right after the "Get items"  I have a bunch of sub actions in Apply to each 5 that I can't lose.


applyToEach.png

I have the same question (0)
  • Verified answer
    v-jefferni Profile Picture
    on 21 Dec 2021 at 03:26:53
    Re: Removing apply to each

    Hi @MsnowWI ,

     

    You will not be able to drag out or copy the actions that within apply to each, please try:

    1. save the current flow.

    2. open the power automate portal on another tab:

        https://us.flow.microsoft.com

    3. create a new flow.

    4. copy parameters you need from the old flow and paste to the new one.

     

    Hope this helps.

     

    Best regards,

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

  • Community Power Platform Member Profile Picture
    on 21 Dec 2021 at 12:49:17
    Re: Removing apply to each

    HI @MsnowWI ,

     

    You should always avoid nested flows!

     

    If you know that you will only ever have one item in the result of get items. Then you can avoid them:

     

    https://sharepains.com/2020/09/17/unwanted-apply-to-each-power-automate/

     

    Other ways to void them include using a select action when you are processing data. So that you massage the data into a single level array first.

     

    You can also sometimes use the method described in the post below:

     

    https://sharepains.com/2020/03/11/pieters-method-for-advanced-in-flows/

     

    it all depends a bit on what you are doing inside the apply to each steps.

     

  • agregoriades Profile Picture
    11 on 01 Sep 2022 at 15:20:15
    Re: Removing apply to each

    I figured out how to do it.  You have to remove all the references to other parts of the flow from the steps inside the for each.  Then you will be able to move them out.  Then you can put the references back in.  It's a pain, but better than rebuilding the whole flow from scratch.

  • Semisi Profile Picture
    2 on 02 Oct 2023 at 20:40:47
    Re: Removing apply to each

    Depending on how big your flow is, you can;

    1. Re-create the action before or after the apply to each box
    2. Add a parallel branch if it's the last step

    Copy it over then delete the Apply to Each box.

     

    Hope this helps.

  • buddyboy Profile Picture
    8 on 18 Oct 2023 at 15:34:32
    Re: Removing apply to each

    You have to drag the 2nd level Appy to Each to a "Add an action" or "Insert a new step" and the procced on to lower levels.

    I want to move the "Apply to each 7" from outside of the block of the "Apply to each 4". I need to move it to a new Action or Step. I need to also include the "Apply to each 5" in my moving.

    buddyboy_1-1697643080210.png

    As you can see in this illustration below the "Apply to each 7" & "Apply to each 5" is no longer inside the block of the "Apply to each 4" operation. You must drag the "Apply to each 7" to an "Add an action" or "Insert Step" that is outside of the block of the "Apply to each 4".

    buddyboy_2-1697643260349.png

     



Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 655 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 371 Moderator

#3
chiaraalina Profile Picture

chiaraalina 276

Last 30 days Overall leaderboard
Loading started
Loading complete