Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

remove items from array that are also in 2nd array

(0) ShareShare
ReportReport
Posted on by 27

Hi, 

 

I have 2 separate arrays in my flow that contain some of the same data. I want to remove the items from array (A) that are also present in array (B). 

So

(A) = [111, 222, 333, 444] 

(B) = [111, xxx, 444]

Should result in 

(C) = [222, 333]

 

Any clue what would be the best way to do this?

 

Thanks

  • Verified answer
    v-yueyun-msft Profile Picture
    on at
    Re: remove items from array that are also in 2nd array

    Hi , @kiki_musampa 

    According to your description, you want to remove items from array that are also in 2nd array.

    Here are the steps you can refer to , this is my flow:

    vyueyunmsft_0-1698975035077.png

    (1)The first three initial variable: 

    vyueyunmsft_1-1698975073812.png

    (2)The "Apply to each" step is like this:

    vyueyunmsft_2-1698975151158.png

    contains(intersection(variables('ListA'),variables('ListB')),item()) 
     
    Then the last compose is to test the ListC we get in the end , the result is as follows:
    vyueyunmsft_3-1698975194000.png

     

     

    Best Regards,

    Yueyun Zhang

     

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492