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 / Send email to user bas...
Power Automate
Answered

Send email to user based on a department column value

(0) ShareShare
ReportReport
Posted on by 613

Hi,

How do I send email to user based on a department column value on dataverse? Have a table with name, dept, email address:

NameDeptEmail
Test1ITTEST1@abc.com
Test2HR TEST2@abc.com
Test3IT TEST3@abc.com
Test4Marketing TEST4@abc.com

Based on the above table I need all the users addressed to a single dept to go out as an email from the TO field on email connector. Right now it is picking individual email addresses and sending to departments. Eg.: the email should go to Test1;Test3 for IT on a single email. Appreciate your inputs.

Categories:
I have the same question (0)
  • Verified answer
    DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @Teresa24486 

     

    I have copied your table into excel, same idea, first part is listing the rows, performing a select action using "text mode" in order to get the dept in an array and then using union in a compose to create a list of unique depts.

     

    DamoBird365_0-1633167375244.png

    2nd stage is an apply to each on the unique departments, filter the list rows array where the dept is equal to current item (i.e. the unique dept 1of 3).  Then using a select where the from is the body of the filter and the map (text mode again) is item()?['email'] (you will have to type the expression), you can then join the array of emails with a smie colon and use in an email.

     

    DamoBird365_1-1633167458188.png

     

    The output is like so:

    DamoBird365_2-1633167553259.png

    If you are new to arrays, take a look here https://youtu.be/6nJSUNh579w

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Cheers,
    Damien


    P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

     

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