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

Notifications

Announcements

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

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 (1)
  • Verified answer
    Pstork1 Profile Picture
    68,717 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
    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
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard