Skip to main content

Notifications

Power Automate - Building Flows
Suggested answer

Compare 2 SharePoint lists and send and email

Posted on by 3
Hi
 
I am trying to compare 2 SP lists.  In both lists i am comparing the a text field which has an email address (can not use people picker, as includes external email addresses). List A is the full list of expected responders.  List B is the responses received from a completed form.  I need to compare and get the emails that do not appear in list B and send an email.
 
i have manage to get this to send the email when the condition is false but as it is in a apply to each, it sends multi emails to the emails that do not appear in list B.  if i take the email out of the apply to each it will send to all in list A.
 
if anyone can assist that wold be great, thank you
  • Suggested answer
    abc 123 Profile Picture
    abc 123 629 on at
    Compare 2 SharePoint lists and send and email
    Don't send the email from that loop, just collect the distinct values into an array. (Before populating the array, check to see if it's already exists, such that you don't duplicate.)
     
    Once that loop is finished, then loop through the Array, and send the emails. 
  • Suggested answer
    Pstork1 Profile Picture
    Pstork1 64,014 on at
    Compare 2 SharePoint lists and send and email
    1) You can use a Data Select to map the Email addresses in each list to an array. Make sure to toggle the mapping to get just an array of emails.
    2) Then use a Union() on those two arrays to generate an array of all the Unique Emails that appear in both lists.
    3) You can then do a filter array to see which emails in the first list are Not Contained in the unique list
    4) The do an Apply to each on the filtered array and send an email to the resulting list of emails.

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,487

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,014

Leaderboard