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 / Sending email to users...
Power Automate
Answered

Sending email to users in a multi-user column and their AD manager

(0) ShareShare
ReportReport
Posted on by 37

Hi, This question is related to the post => https://powerusers.microsoft.com/t5/Building-Flows/How-can-I-send-one-email-to-users-in-a-multi-user-column-in/m-p/1709706#M189637

 

I want to send users an email in a multi-user column (in an item) upon creation of the list item. Their AD managers should also be copied into the email in the CC box. 

 

The flow I built to acheive this contains a "apply to each" with user's name (which I gather from the list), I use it to get their AD Manager; I then append manager's email to an array, and email addresses are joined by a semi-colon.

 

I do similar with the user's email address where I gather their email address from then list item, then add to an array, seperated with a semi-column.

 

Prety sure there's an issue with the way I've constructed this under "apply to each" action, can you help? I've attached a screenshot that shows the relevant sections in the flow.
b329f0b8-bfb1-4e1e-85a0-42e8346fe733.png

Categories:
I have the same question (0)
  • devendraVelegan Profile Picture
    72 on at

    @thilla99 : What error are you getting while getting the manager email? 

    Also, you do not need to select fields to get the manager's email, and it is optional. 

     

    Sometimes, AD mightn't have manager details populated, so make sure to check for the null values. 

  • thilla99 Profile Picture
    37 on at

    Sorry, I should have added, the flow is adding the user and user's manager email correctly, the issue is that it seems to add the first user and his/her manager, then sends an email.

    then it appends the next user & relavent manager and sends another email, consequently it repeats these steps for the number of users in the column, resulting multiple emails.

    What I want to do is, obtain all users in the column (in the relevant item) and their relevant managers and send one email.

     

  • devendraVelegan Profile Picture
    72 on at

    @thilla99 : Please bring the send email action outside of "Apply to each" to avoid sending multiple emails. 

  • thilla99 Profile Picture
    37 on at

    Thanks, yes I've tried that. when I bring it outside "apply to each" I can't add the outputs from recipient & manager 'join' actions; or is there an easer/ better way to collect email addresses for recipients (will be in To: box) & managers (in CC: box)?

  • devendraVelegan Profile Picture
    72 on at

    @thilla99 : you need to declare the recipient & manager outside the "Apply to each" action then you will be able to use the variables in send email action. 

  • thilla99 Profile Picture
    37 on at

    @devendraVelegan The two variables have already been decalated outside (at the top).

    'Apply to each' seems to repeat the same actions (within it) for each recipient name as oppose to appending the email address to array. If I take out the email action out of "apply to each" I can't add the "Joins".

    Not sure how to prevent repeating the same actions for each recipient.

    See attached for reference.

    thilla99_0-1660689067435.png

     

     

  • Verified answer
    v-liwei-msft Profile Picture
    Microsoft Employee on at

    Hi @thilla99 ,

     

    Could you please tell me:

    Do you mean that when you send a message to the second recipient and manager, you repeatedly send the message to the first recipient?

    The problem is in Apply to each and Append to array variable.
    When Apply to each iterates over the current item, the Append to array variable appends a new recipient message to the array variable, but still retains the email address of the previous item.

    I'll give you two ways to avoid sending duplicate messages:

    1.Place the sending email inside The Apply to each.

    vliweimsft_0-1660800534588.jpeg

    2.Put the sending email outside of The Apply to each.

    vliweimsft_1-1660800564494.jpeg

     

    Best Regards,

    Levi

     

     

  • thilla99 Profile Picture
    37 on at

    Hi @v-liwei-msft 
    Thanks. Good news! I got it to work, I followed your 2nd suggestion, I moved both the email and join actions out of the "apply to each", just left "append to array" actions inside "Apply to each".

     

    While this worked ok, for multiple users with the same manager, it appended the same manager multiple times into CC: box, I suppose there's no way around to add just one instance of the manager email addresss? i.e. remove duplicates from an array?

     

  • v-liwei-msft Profile Picture
    Microsoft Employee on at

    Hi @thilla99 ,

     

    You can use the union function to remove duplicates from an array.

    I have made a test for your reference:

    vliweimsft_0-1660872195673.jpeg

    vliweimsft_1-1660872213085.png

    vliweimsft_2-1660872230886.png

     

    Best Regards,

    Levi

     

  • thilla99 Profile Picture
    37 on at

    @v-liwei-msft  Thank you for that. I finally have success with this. The "union" function did do the trick and removed the duiplicates.

    Thank you.

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 67

#2
David_MA Profile Picture

David_MA 64 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 39 Most Valuable Professional

Last 30 days Overall leaderboard