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 Apps - Building Power Apps
Answered

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,987 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 632 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 386 Super User 2025 Season 2

#3
wolenberg_ Profile Picture

wolenberg_ 245 Moderator

Last 30 days Overall leaderboard