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 / Unwanted 'Apply to Each'
Power Automate
Answered

Unwanted 'Apply to Each'

(0) ShareShare
ReportReport
Posted on by 4

Hi

 

I am trying to create a simple power automate flow that sends a customised email to a when a specific field is update in a SharePoint list. I keep getting unwanted ‘Apply to Each’ loops when I go to send the email. (I am basically trying to create a simple help desk/ticketing system, but the examples in the forums/youtube don’t quite meet my requirements.)

 

My SharePoint list automatically captures an incoming email (a general support request) and breaks the information into applicable columns (email from, email subject, email body etc). A team manager then adds some task instructions via another column and identifies an officer to carry out the task (person or group column).

 

I have a yes/no column that is set up as the condition to ‘trigger’ the sending of the task or email, but once I try to configure the email under the ‘yes’ condition and add the field that has the ‘task assigned to’ username email variable power automate adds the ‘apply to each’ loop which causes multiple emails to be sent, which is undesirable.

 

Is there a straight forward way to switch off the automatic Apply to Each or some other way to avoid it? Or do I need to do an array and pull each item out, or use compose, or individual get item?

 

Thanks in advance

Captureee.JPG

 

 

Categories:
I have the same question (0)
  • tom_riha Profile Picture
    10,187 Most Valuable Professional on at

    Hello @somedudeWA ,

    the 'Apply to each' is added automatically because the 'Task assigned to' column is set to allow multiple users. If it allows multiple selection then Power Automate must be prepared to process all the users in a loop. If you switch it to a single user column it'll not add the 'Apply to each'.

    Also, the 'Apply to each' doesn't matter if you enter just a single user as the task assignee, it'll loop only through that 1 user = it'll run only once.

    But if you need to send the email to multiple users at once, you can 'Initialize a variable' of a string type, then inside the 'Apply to each' use 'Append to string variable' and add each email address into the variable with ; (separator between emails) at the end. Then you could move the 'Send an email' out of the 'Apply to each' and send just a single email to users in that variable.

  • Verified answer
    Paulie78 Profile Picture
    8,422 Moderator on at

    You can do it without any loops. The value is array, so you need to use a function that will deal with it as such. Use a select action and for the from use:

    triggerBody()['Task_x0020_assigned_x0020_to']

    You may have to tweak the field name. Then switch the select action to text mode and just put in:

    item()['Email']

    Then after the select add a compose which joins the components of the newly created array, which contains only email addresses:

    join(body('Select'), ';')

    Which will produce a string of email addresses, separated by semi colons. Which is what you need for your email action.

    TaskAssignments.png

  • Peter_Comman Profile Picture
    19 on at

    Thanks, Tom & Pauli,

    both your explanations helped me to finally understand the apply to each - step.

    Super useful solution on plus.

    Cheers!

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 589

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 284 Super User 2026 Season 1

Last 30 days Overall leaderboard