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 / Get Items from SP List...
Power Automate
Answered

Get Items from SP List then Email Each Item Owner - sends multiple emails

(0) ShareShare
ReportReport
Posted on by 2

I have a Flow set up to retrieve ant items matching a filter query, then email the Key Stakeholder of that list item. The idea is that the flow sends an email to each item key stakeholder about that list item. Then updates the list item to state an email has been sent. Simple right? NO.

The Get Items part works, and the update list item works, however the send email action sends an email for each item returned to each Stakeholder resulting in several emails sent to each person. Not what I want, the idea is that the Stakeholder receives an email for the item that is assigned to them. I have tried adding a Get user Profile step in to the Apply to Each stage instead of using email Key Stakeholder (the result returned from the list), but it falls down when I try to select send email for Current Item in the Second Apply to Each step causing the flow to fail.  How do I tell it to get the user for the list item, then email that user about that list item only, not the other list items returned in the get items step?

 

 

Example of FlowExample of Flow

 
Categories:
I have the same question (0)
  • v-bacao-msft Profile Picture
    on at

     

    Hi @Ruth_Mc ,

     

    One thing we need to know about Key Stakeholder filed, is it a person field allows multiple selections?

     

    If this filed always pick one person, please consider disable allow multiple selections of this filed.

     

    Do you only want to get the items responsible for Key Stakeholder contained in the item mentioned in the trigger?

     

    Please provide more detail so that we could provide a proper workaround for you.

     

    Best Regards,

  • Ruth_Mc Profile Picture
    2 on at

    Hi @v-bacao-msft The Key Stakeholder field is a people picker field currently set to allow multiple selections, however I can easily change this as mostly there is only one Key Stakeholder.

     

    The Get Items action after the trigger of When and Item is created or modified, needs to get all items marked as 'Email Stakeholder' in another choice column. Then I want the flow to send a separate email for each individual list item returned to the person marked as the Key Stakeholder on that list item. Mostly there should only be one email per person as the Key Stakehoder will be different on each item. Currently each stakeholder is getting a separate email for ALL the items returned, not just their own one! Not ideal.

     

    Hope that helps clarify.

     

    Kind Regards, Ruth

  • Verified answer
    v-bacao-msft Profile Picture
    on at

     

    Hi @Ruth_Mc ,

     

    If you could set the person field to allow only one selection.

    Please try to refer to the following method to group items by Key Stakeholder.

     

    • Initialize array variable to store all Key Stakeholder’s emails in filtered items.
    • Use Append to array variable action to append emails to the variable.
    • Initialize array variable to store the data that need to be displayed in the HTML table.
    • Use union() function to remove the duplicate emails from the Key Stakeholder variable.
    • Iterate the above result and get the items which contain the same Key Stakeholder.
    • Append the details of the item to the HtmlTable array. Finally, create an HTML table and send it by email.
    • At the end of each loop, we need to use Set variable action to clear HtmlTable array.

    Image reference:

    124.PNG125.PNG126.PNG

     

    Best Regards,

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 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard