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 / Show items not in both...
Power Automate
Suggested Answer

Show items not in both arrays

(0) ShareShare
ReportReport
Posted on by 2
I am trying to work out how to show items that are not in two arrays.
I have one from a RESTAPI from out finance system that shows what accounts are valid with which cost centres;
[
{
"Acc": "N3200",
"CostC": "W61000"
},
{
"Acc": "N4500",
"CostC": "W62000"
}
]
 
I then have an excel file (neatened a little)
 
[
{
"Acc": "N3200",
"CostC": "W61000"

},
{
"Acc": "N4500",
"CostC": "W61000"

},
{
"Acc": "N3200",
"CostC": "W62000"

},
{
"Acc": "N4500",
"CostC": "W62000
"
}
]
I can use intersect to get the underlined items that are in both arrays.  I can use filter to filter by account and/or cost centre (but that just shows all entries).
 
What I can't work out how to do is filter the excel based array to show the items where a combination of account and cost centre aren't in the RESTAPI array (the bold items).
Categories:
I have the same question (0)
  • Suggested answer
    David_MA Profile Picture
    15,205 Super User 2026 Season 1 on at
    I think what you are actually asking is how do you find the differences between two arrays rather than what is missing in two arrays. Otherwise, you would need a third array of the values to check if they are missing from the first two arrays.
     
    If this is actually your use case, check out this: List values missing in an array using Power Automate
     
    It has been some time since I used this, but it worked.
  • Chriddle Profile Picture
    8,713 Super User 2026 Season 1 on at
    Filter the objects form Excel with the following:
     
    <array of objects from API> does not contain   @item() 
  • DO-11111502-0 Profile Picture
    2 on at
    I have managed to get this to work but not by using the filter method (that I think should work).
     
    It works if I convert it to xml and add a property (Validation) then filter on validation.
     
     
    If I try to use filter array,  then it filters on Account and CostC separately.  So the returned value is blank (as both N3200/N4500 exist, as well as W61000/W62000).
     
     It could just be a logic issue when combining the two not-contains functions.
     

    and(not(contains(body('SelectRESTAPIAccount'),item()?['Account'])),not(contains(body('SelectRESTAPICostC'),item()?['CostC'])))

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 252 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 169

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard