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 / Stop apply to each sen...
Power Automate
Answered

Stop apply to each sending multiple emails

(0) ShareShare
ReportReport
Posted on by 453

Hello,

 

I've create a flow that takes responses from a form and has a condition in place that checks that a title in planner contains the same name entered in the form. If Yes, then additional tasks are added to the Planner task. 

 

However, if the name entered in the form does not match up with a name in the title of a planner task, an email needs to be sent to the responders email to inform them that they have either spelt the name incorrectly or they have submitted the form too early. For info, this process is for new starters, and both the name and order of when things are submitted needs to be correct.

 

Unfortunately when I add send email in the No section, it is applying the email to each task that exists and therefore sending multiple emails - i understand why this is happening but not sure how to achieve my desired outcome.

 

Is there a way that where I can send an email back to the responder, if the name does not match with any existing tasks, without it applying to each task.

 

JoshPullan11_0-1681913811836.png

 

Any help would be greatly appreciated 🙂

 

Thanks,

Josh

Categories:
  • Verified answer
    Manish Solanki Profile Picture
    15,169 Moderator on at

    Hi @jap11 

     

    Please add the following action in your power automate flow:

    1. Before apply to each loop, initialize a variable :

    ManishSolanki_0-1681921281236.png

    2. Next, in the if condition when taskname found then in the 'Yes' section or path after 'Add a row into a table 2' action, set the variable to true as shown below:

    ManishSolanki_1-1681921471162.png

     

    3. Finally, in the end add a condition to check if taskname is not found then trigger an email to the requestor as shown below:

    ManishSolanki_2-1681921579270.png

     

    Please let me know if you have any questions.

     

    Please remember to give a 👍 and accept my solution as it will help others in the future.

  • Jap11 Profile Picture
    453 on at

    @ManishSolanki - that has worked perfectly.

     

    Thanks so much for your help.

  • Y1 Profile Picture
    20 on at

    Hi @ManishSolanki,

     

    Can you kindly share the expression language you used for false condition, thanks.

     

    Y1_0-1695792528307.png

     

  • Manish Solanki Profile Picture
    15,169 Moderator on at

    Go to expression window and type false as shown below:

    ManishSolanki_0-1695794189962.png

    false

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • Y1 Profile Picture
    20 on at

    Hi @ManishSolanki,

    Let me give you some back round on my flow, it's similar to the above flow.

    My flow the trigger is from Forms then looks at sharepoint file and if a station code mentioned in forms matches station code listed in sharepoint it sends email to that station from an email in sharepoint but if there is no match it sends email as well to specific email id. The issue I'm facing is when there is no match it sends multiple emails and I have implemented the above solution but it did not work. Can you kindly check my flow and see where I'm going wrong, thanks. 

    Y1_0-1695796643131.pngY1_1-1695796721059.pngY1_2-1695796769262.png

     

  • Manish Solanki Profile Picture
    15,169 Moderator on at

    Hi @Y1 

     

    Please correct the initialize variable action for 'Send email'. It should have an expression for false value:

    ManishSolanki_0-1697608067631.png

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • Manish Solanki Profile Picture
    15,169 Moderator on at

    Hi @Y1 

     

    I had a close look at your flow. I would suggest the following to get the desired result:

     

    1. Use "Get items" action with filter query to fetch only the matching record which will further avoid iterating all records. Here is an example, I am matching Title column in SharePoint with "Title" field in form:

    ManishSolanki_0-1697772350127.png

    <sharepoint field internal name> eq '<form field>'

     

    2. Next, add condition action to check the length of value object returned by Get items action. For that, you need to write an expression. The condition will be if length of value array object is greater than zero (case of record found), then in "Yes" block add "Apply to each" and send an email. If length is zero (case of record not found) then send an email stating that record does not exist.

    ManishSolanki_1-1697772425455.png

    Expression used for calculating the length of value object returned by Get items is:

    length(outputs('Get_items')?['body/value'])

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • Y1 Profile Picture
    20 on at

    Hi @ManishSolanki ,

    Thanks for the solution, it has worked and helped me greatly. 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 377

#2
11manish Profile Picture

11manish 292 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 128

Last 30 days Overall leaderboard