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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / The operation 'termina...
Power Automate
Answered

The operation 'terminate' cannot be used inside a for each - Responses comments switch automatically to ''Apply to each''

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

I'm trying to implement a Delay as a // branch. My issue, which I see a lot of people having, is that i get an error message stating ''

The operation 'terminate' cannot be used inside a for each.''
 
I need the ''Responses comments'' to send to the initiator, and as soon as I add this variable content, it switches it to an ''Apply to each'' window.

 

I put a screenshot of my flow below to illustrate.

 

iamlaszlo_0-1608302238429.png

 

If somebody has any idea how I could overcome this issue, it would be wonderful !

 

Thanks in advance.

 

KR,
Laszlo

Categories:
I have the same question (2)
  • Verified answer
    Pstork1 Profile Picture
    69,121 Most Valuable Professional on at

    You get the Apply to Each loop because responses is always a collection.  Even if its only one approver responses would be a collection or one.  If you only have one approver then you can use the First() function to get the comments of that first approver without an Apply to Each.

     

    I assume you are trying to use the terminate to exit the loop.  But as you have seen terminate can't be used inside a loop, because terminate stops the entire flow, not just the loop.  If you want to be able to exit a loop before it completes you'll need to use a Do Until loop instead of an Apply to Each loop.  Then you can exit the loop by setting the value the loop is checking inside the loop.

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello,

     

    Thanks for jumping that fast at my rescue, much appreciated.


    I got what you mean, but I'm afraid I dont know how to put that in place.


    Let me share you my sharepoint list, hoping you see it clearer

    iamlaszlo_0-1608303763449.png

     

    My understanding is that I need to add this first() loop where I highlighted below right ?

    iamlaszlo_0-1608304382588.png

     

     

    And you are right, I'm trying to terminate to exit the loop if the first user completed the task before the delay is being triggered.

     

    Thanks for your help again

     

    KR,

    Laszlo

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I think I found out how to do it using your answer here ; Solved: Approval workflow - apply to each - Power Platform Community (microsoft.com)

     

    Thanks again for your help and I accept it as a solution

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 557

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 264 Super User 2026 Season 1

Last 30 days Overall leaderboard