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

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Get unique and common ...
Power Apps
Unanswered

Get unique and common values from 2 collections

(0) ShareShare
ReportReport
Posted on by 229

Hi, 

 

I have two collections with the following items:

colBase: [1, 2, 3]

colRec: [3, 4, 5]

 

With this info I want to split colRec in two collections. One including the items that are in colBase and another one with items that are not in colBase. So in the example above, I should get

colRec1: [3]

colRec2: [4, 5]

 

I'm trying to find the right formulas to do this but not sure it is possible. Any help to point me in the right direction is appreciated. 

 

Many thanks

Categories:
I have the same question (0)
  • Verified answer
    mdevaney Profile Picture
    29,989 Moderator on at
    Re: Get unique and common values from 2 collections

    @Sam4 

    Here's my take on it:

    //starting collections
    ClearCollect(colBase, [1, 2, 3]);
    ClearColelct(colRec, [3, 4, 5]);
    
    //solution collections
    ClearCollect(colInColBase, Filter(colRec, Value in colBase.Value);
    ClearCollect(colNotInColBase, Filter(colRec, !(Value in colBase.Value));

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Sam4 Profile Picture
    229 on at
    Re: Get unique and common values from 2 collections

    thanks @mdevaney This worked for me. (apologies for the delay, I lost the access to my account and just recovered!)

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard