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 / Compare two arrays for...
Power Automate
Unanswered

Compare two arrays for missing elements

(0) ShareShare
ReportReport
Posted on by

Hi everybody,

 

I'm looking for a way to compare two arrays and find missing items.

In my case, Array #1 contains a list of people who need to complete a task:

[
  {
    "DisplayName""Person A"
  },
  {
    "DisplayName""Person B"
  },
  {
    "DisplayName""Person C"
  },
  {
    "DisplayName""Person D"
  }
]
 
The second array contains a list of people who actually completed the task:
[
  {
    "DisplayName""Person A"
  },
  {
    "DisplayName""Person D"
  }
]
 
I'm now looking for a way to identify those who didn't complete the task. So the result array should contain Person B and Person C. Is there a convenient way of doing it in Power Automate?
 
Thanks in advance!
Categories:
I have the same question (0)
  • ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi @BenWishh 

     

    Here is the sample flow.

     

    I have stored both the input arrays in compose actions:

    ManishSolanki_0-1705671554998.png

    [
    {
    "DisplayName": "Person A"
    },
    {
    "DisplayName": "Person B"
    },
    {
    "DisplayName": "Person C"
    },
    {
    "DisplayName": "Person D"
    }
    ]

    ManishSolanki_1-1705671586610.png

    [
    {
    "DisplayName": "Person A"
    },
    {
    "DisplayName": "Person D"
    }
    ]

    Next, add "Select" action to create plain array of values present in compose 2 action:

    ManishSolanki_2-1705671702990.png

    click "Switch map to text mode" and enter the below expression:

    ManishSolanki_3-1705671777701.png

    item()?['DisplayName']
    Finally, add filter array action & pass output of compose action as its input:
    ManishSolanki_4-1705671858643.png

    click "Edit in advanced mode" and enter the below query:

    @not(contains(body('Select'), item()?['DisplayName']))

    The output of filter array will give the desried result.

     

     

    Output:

    ManishSolanki_5-1705671959984.png

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard