Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

Email being sent to same user multiple times

(0) ShareShare
ReportReport
Posted on by

Scope - When Case = Priority --> "Breakdown" --> send email to Users Associated to Case via Account Relationship

 

Tables Used: Case, Account, Account User Relationship, Users, Customer Asset

 

  • The Account table contains a custom table called "Account User Relationship" that is 1:N 
    • The Account User Relationship contains is a User lookup to the Account 

Goal: When a Case equals A Priority of "Breakdown" a flow should trigger an email to be sent to all Users Associated to the Case (Customer AKA Account) via the Account User Relationship Table

 

Problem: If a User is associated to multiple Accounts via the Account User Relationship table, When a Case status = "Breakdown", the User will receive the equal number of emails they are related to on the Accounts User Relationship 

 

(For Example, If User A is associated to 5 Accounts via the Account User Relationship, when 1 Case equals = Breakdown, User A will receive 5 emails pointing to the same Case record.) they should only receive 1 email for that 1 Case record associated to the 1 Account. What am I missing here? 

 

KmacHS_0-1663690141732.png

KmacHS_1-1663690178236.png

KmacHS_2-1663690267406.png

Here we Filter the List of  Account User Relationships through Fetchxml:

Filters: Where the Account User Relationship (Account  Contains Data) AND the (Case Priority equals a "Breakdown" value (4))

KmacHS_3-1663690645649.png

KmacHS_4-1663690670249.png

Here we Filter the List of Users through Fetchxml:

KmacHS_5-1663690797786.png

We capture the Record URL

KmacHS_6-1663690884184.png

From here we Apply to each ---based upon  values from the List of Users 

and send email to each. 

  • Mitanshu Profile Picture
    1,614 Super User 2025 Season 1 on at
    Re: Email being sent to same user multiple times

    In the last step, before you do "Apply to Each" and send email ... 

     

    Use Select function to get an array of emails - I will call this array as emailArray.

     

    Now use union(outputs('emailArray'),outputs('emailArray')) expression to get an array of unique emails.

    Finally, send an email to this array of unique emails.

     

     

    happyume_0-1663702484976.png

    Above screenshot is building flow, where emailArray has duplicate emails.

    Bottom screenshot shows the result where outputArray has unique emails only.

    happyume_1-1663702565930.png

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If this post or my previous reply was useful in other ways, please consider giving it Thumbs Up.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,651 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow