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

Anonymous
2025-01-21T19:45:35+00:00

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:

Microsoft 365 and Office | SharePoint | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Anonymous
    2025-01-21T23:56:13+00:00

    Dear Jo Anna Hatcher,

    Greetings! Thank you for posting to Microsoft Community. We are happy to help you.

    We went through your thread carefully and understand your concern about Power Automate flow. Since it's related to Power Automate, we would like to request you to post your detailed concern in the related community i.e., Microsoft Power Platform Community Forum to get the detailed help from the experts.

    Please accept my sincere apologies for not being able to resolve the problem and for redirecting you to different community as the members in the category posted focus on the users with the Microsoft 365 and SharePoint concern and have limited knowledge on the Power Automate, so to get the fast and better assistance, we have redirected you in the correct path. I regret any inconvenience this may cause.

    Once again, I apologize for the inconvenience this has caused. We appreciate your patience and understanding and thank you for your time and cooperation.

    Hope you stay safe and healthy.

    Sincerely,

    Rhoda | Microsoft Community Moderator

    0 comments No comments