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 object arr...
Power Automate
Answered

Compare two object arrays by specific key and save non-duplicates

(0) ShareShare
ReportReport
Posted on by 8

I've created two object arrays. I would like to compare the two array items by 'SpaceId' key, then add whatever items don't match to a third array. Here is a sample of my two arrays:

Screen Shot 2021-04-26 at 3.25.00 PM.pngScreen Shot 2021-04-26 at 3.25.07 PM.png

 

I would like my condition to be if variable(array1)['SpaceId'] is not equal to variable(array2)['SpaceId'] then append to a 3rd array.

If they are equal then do nothing.

 

I'm pretty sure my syntax is probably totally off but I hope I'm getting my goal across. I'm new to the game so I would appreciate any help that I can get with this.

 

Categories:
I have the same question (0)
  • Verified answer
    PrasadAthalye Profile Picture
    on at

    Here is how you can do it...

     

    PrasadAthalye_0-1619479850760.png

     

    Compose2 Expression --> item()?['spaceid']

     

    Filerarray expression --> item()?['spaceid']

     

    Check Length expression -->length( body('Filter_array'))

     

    Finally append to array expression --> body('Filter_array')[0]

     

  • PrasadAthalye Profile Picture
    on at

    @dgonzalesjr - Did you get chance to check my solution?

  • PrasadAthalye Profile Picture
    on at

    @dgonzalesjr - Did you get chance to check my solution?

  • dgonzalesjr Profile Picture
    8 on at

    Hello @PrasadAthalye so sorry for the wait. This solution has worked for me. Thank you so much for your help!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 711

#2
Vish WR Profile Picture

Vish WR 691

#3
Haque Profile Picture

Haque 525

Last 30 days Overall leaderboard