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

Announcements

News and Announcements icon
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)
  • Manish Solanki Profile Picture
    15,169 Moderator 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 389

#2
Vish WR Profile Picture

Vish WR 331

#3
David_MA Profile Picture

David_MA 298 Super User 2026 Season 1

Last 30 days Overall leaderboard