Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

Multiple emails send through Apply Each

(0) ShareShare
ReportReport
Posted on by 4

Hi,

 

I have created a flow as shown in the images below. The flow is triggered when the user fills a form, which has field for the user to enter their name. I have an excel table with three columns, which kind of looks like this:

 

Name  Email  Response

xyz

abc

pqr

....

....

...

 

The Name column has multiple entries. I want to send the user a success mail if their name is in the table and I want to send them a failure mail if their name is not. With the flow that I have created, the user is being sent multiple mails and I can understand why that is happening.

 

However, I am not able to figure out, on how I can steer out of this situation. Any help would be appreciated.

 

Thanks

  • grantjenkins Profile Picture
    11,059 Super User 2025 Season 1 on at
    Re: Multiple emails send through Apply Each

    This should get what you're after. Effectively, it will build up an array of Names from your Excel Table, then check to see if that array of Names contains the Name that was entered in the Form.

     

    My Excel Table for this example is below:

    grantjenkins_1-1668945141791.png

     

    And my super complex form 😉

    grantjenkins_2-1668945174202.png

     

    Below is the full flow. I'll go into each of the actions.

    grantjenkins_0-1668945112065.png

     

    The first three actions are fairly straight forward. When a new response is submitted and Get response details retrieves the output of our Form. List rows present in a table returns all the rows in our Excel Table.

    grantjenkins_3-1668945283907.png

     

    Next, we build up a simple array of Names from our Excel Table data. We use a Select for this using value from List rows present in a table and go into Map to text mode (icon on bottom right as shown by the arrow below) and add the Name field.

    grantjenkins_4-1668945412924.png

     

    This will give us the following output:

    [
     "Bob",
     "Jane",
     "Bill",
     "Jack",
     "Jill",
     "Mary"
    ]

    grantjenkins_5-1668945511780.png

     

    We can then use the output from our Select to check if the array of Names contains the Name we entered in our Form. If it does, we go into the Yes branch, otherwise the No branch.

     

    grantjenkins_6-1668945579431.png

     

  • SudeepGhatakNZ Profile Picture
    14,303 Most Valuable Professional on at
    Re: Multiple emails send through Apply Each

    Your email action is inside a loop (executing for each item in your worksheet) which is why it sends multiple emails.

    When the item matches they receive the email in your "Yes" branch otherwise they receive the email in the "No" branch.

    You need to review the logic again.

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,702 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow