web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Comparing two arrays - emailing to the difference

(0) ShareShare
ReportReport
Posted on by 2

Hello,

 

I am making a flow where I send out automated e-mails.

I have a flow set up where the e-mail is only send to the dealers existing in my monthly report that need to do a follow-up.

 

However, I have a list with all the dealers and sometimes not all the dealers are in the monthly report.

I also want to send them a confirmation e-mail that indeed they don't need to follow up on anything.

 

Is there a way to compare these two arrays with eachother?

For instance, when I send an e-mail to a dealer from my monthly report. I append that dealer name to an array variable. (1)

Then I want to make an array variable containing all the dealer names. (2)

 

I want the difference between arrays (1) and (2), so I can make an "Send email to" for these values.

I have the same question (0)
  • JamesYumnam Profile Picture
    on at
    Re: Comparing two arrays - emailing to the difference

    Hi @Justin_Keijzer  it would be great to know where you are maintaining these lists to help you accurately on how to import and use them.

    For now, considering that you have them maintained in one of the supported datasources, you will have to import them first in the flow. Then create arrays to store the values from these lists and compare these arrays. To start with creating the arrays and comparing them, please check the below actions:

    JamesYumnam_0-1627045405657.png

     

  • Mitanshu Profile Picture
    1,644 Moderator on at
    Re: Comparing two arrays - emailing to the difference

    If you use expression: intersection(Array1,Array2) - then you will get common values which are present in both Arrays.

    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 the content was useful in other ways, please consider giving it Thumbs Up.

     
  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at
    Re: Comparing two arrays - emailing to the difference

    Hi @Justin_Keijzer 

     

    Take a look at the following article https://www.damobird365.com/efficien-union-except-and-intersect-great-method/

     

    You can use a filter array action to compare two arrays, rather than an apply to each.

     

    You can also use a select to return an array of emails.

     

    DamoBird365_2-1627049599843.png

     

     

    In your filter array, from is equal to the list with all the dealers and then you filter the 2nd array (those who are to be sent the report) "does not contain" one of the emails i.e. item(). This will return an array of emails for those that do not feature in the report array but do in the original list of all.

     

    You can see that the FROM Input of the Filter Array has 4 emails, and the output is a list of those that are not in the OUTPUT of the Report Array.

    DamoBird365_3-1627049841795.png

    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

Coming soon: forum hierarchy changes

In our never-ending quest to improve we are simplifying the forum hierarchy…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 535 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 348 Moderator

#3
developerAJ Profile Picture

developerAJ 262

Last 30 days Overall leaderboard