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 / Automating e-mails to ...
Power Automate
Unanswered

Automating e-mails to single or multiple (array) of Contacts in a List Item

(0) ShareShare
ReportReport
Posted on by 2

I am not having luck with this flow, despite much help from Copilot and Chat GPT. Time to come to the REAL experts.

 

I have a SharePoint list with about 150 items. There are THREE columns with one or more Contacts listed (column type: Person or Group).


I need to build a variety of flows to send e-mail notifications to all or a subset of people in these columns.

 

Steps I have taken that make logical sense, but i continue to get an invalid input paramter to my "Apply to Each" step.

  1. Manual Trigger

  2. Get Items

  3. Initialize Variable String: 'AllEmails'

  4. Outer "Apply to Each" loop: Expression: body('Get_items')?['value']

  5. inside loop, Condition Step to see if the field tields an array or a single object.

    1. True Branch: Expression (for multiple contacts (array) detected: @equals(type(items('Apply_to_each')?['Preparer_x003a_']), 'Array')

      1. Apply to Each 1: expression: items('Apply_to_each')?['Preparer_x003a_']

      2. Append to String Variable: variables('AllEmails') & items('Apply_to_each_nested')?['Email'] & ','

    2. False Branch: Append to String Variable: variables('AllEmails') & items('Apply_to_each')?['Preparer_x003a_']?['Email'] & ','

  6. I will (in future) repeat all of step 5 above for the other 2 columns that have contacts in them. For now, I want to get this correct with just one column.

  7. Compose (Split Emails into Array): split(variables('AllEmails'), ',')

  8. Compose (Remove duplicates): union(outputs('Split_Emails'), outputs('Split_Emails')

  9. Compose (Final Email List): join(outputs('Remove_Duplicates'), ';')

  10. Send e-mail V2: "To" field: outputs('Final_Email_List')

 

I have reviewed each step for syntax, case sensitivity, correct reference step names, etc. However, I cannot save this flow, or run it to see specific outputs or failures. The repeated error i receive is: The input parameter(s) of operation 'Apply_to_each' contains invalid expression(s). Fix invalid expression(s) for the input parameter(s) of operation 'Apply_to_each'.

 

Since there are MANY input parameters, it's not very helpful to show me this without any direction as to which parameter is incorrect.

 

Things i have also done to ensure success:

  1. Temporarily put in a compose step after "Get Items' t see the output- it's pulling data just fine from my SharePoint List.

  2. Confirmed there are no empty fields (i am only testing with FIlter Query of 1 item at this time- it's completely populated on the list.

 

Here is an overview of the structure of the flow steps i have outlined above:

 

Image

Categories:
I have the same question (0)
  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at
    @JH-02011356-0 You might be interested in these YT Tutorials:
     

    Building a Power Automate flow that will send an email with multiple SharePoint items can be a bit complex. In this video tutorial I’ll cover how to build a flow that will send a single email to each user with tasks that have been assigned to them. The logic in this flow can be applied to many different scenarios.

    First, I’ll show you how to use a Filter Query to return items from your SharePoint list that meet your criteria. Then I’ll show you how to return a list of unique email addresses so that each user receives a single email. Lastly I’ll show you how to compose an email that will contain an HTML table with a list of tasks for each user.

    IN THIS VIDEO:
    ✓ How to send multiple list items in a single email with a Power Automate Flow
    ✓ How to create a dynamic date range
    ✓ How to use the Convert Time Zone action
    ✓ How to use a Filter Query in the Get Items action
    ✓ How to count number of items in an array
    ✓ How to use the Select action to extract a users display name and email address
    ✓ How to create a unique list of email addresses
    ✓ How to use the Create HTML Table action
    ✓ How to customize the HTML Table with CSS styles
    ✓ How to use the Send an email (V2) action
    ✓ How to use the Append to String Variable action
    ✓ How to create a custom list of items for an email
    ✓ How to use the Send an email (V2) action
    ✓ How to display singular or plural text based on the number of items returned
     
    ----
     
    How to Handle Multi-Person SharePoint Item Notifications in Outlook and MS Teams with Power Automate

    The tutorial above only covers a scenario where each task is assigned to a single user. What if your task is assigned to more than one user?
    In this Microsoft Power Automate tutorial I’ll cover how to create a flow that is triggered by selecting an item. This automation will send an email to all assigned users for the selected task. I’ll also show you how to adjust your flow so that you can send a message in Teams. Then I’ll show you how to collect a list of unique users that have been assigned to multi-person tasks. Using this concept, we’ll edit the flow from the previous tutorial so that it works with a multi-person column.

    IN THIS VIDEO:
    ✓ How to trigger a flow from a selected file
    ✓ How the multi-person column data outputs
    ✓ How to use the Select action to get all assigned to users of a SharePoint item
    ✓ How to use the Join action to convert an array of email addresses into a string
    ✓ How to send a single email to all assigned to users of a SharePoint item
    ✓ How to send an email to each assigned to user of a SharePoint item
    ✓ How to send a Teams message to each user assigned to a SharePoint item
    ✓ How to return a list of unique users from the multi-person column in a SharePoint list
    ✓ How to use a Filter Array action to return all SharePoint list items assigned to each user
    ✓ How to group Power Automate actions together with the Scope action
    ✓ How to edit a previous flow
     
     
    If you get stuck, toggle off the New Designer and click each action to expand it. Upload a screenshot of your flow in edit mode.
     
    Hope this helps!

    Consider giving me a ❤️ if you liked my response!

    👉 Level up your Power Automate skills by checking out my tutorials on YouTube
    👉 Tips and Tricks on TikTok and Instagram
     
     
  • JH-02011356-0 Profile Picture
    2 on at
    @creativeopinion- this flow works well, thanks for sharing. 
     
    However, in my case, I have contacts in three different columns that need to get certain e-mails. How do a modify your flow to look account for this? 
     
     

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

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard