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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filtering two collections
Power Apps
Unanswered

Filtering two collections

(0) ShareShare
ReportReport
Posted on by 53

Hey there,

 

I am new to PowerApps and working on my first app.  I have spent days trying to figure this out but no luck so grateful if anyone can help me.

 

I have two collections, collectionOne and collectionTwo

 

TableOne 

 

LookupID     Invoice

1                   32

2                   48

3                   49

4                   52

5                   67

 

tableTwo

 

LookupID

 

2

4

5

 

I am trying to filter these two tables and find any matches e.g. 2 and 5 and then get the corresponding invoice number  e.g. 48, 67 to store in a new collection. LookupID columns are both lookups to related dataverse tables.

Filter(

        collectionOne, tableOne[@LookupID].LookupID, Value in collectionTwo[@LookupID].LookupID

       )

 

Any suggestions where I am going wrong would be soooo helpful.

 

 Thanks 

      

 

 

Categories:
I have the same question (0)
  • Verified answer
    anandm08 Profile Picture
    1,936 Super User 2024 Season 2 on at

    hi @GreenFrog ,

    i have implemented a test for your use case and working fine for me give it a try:

    ClearCollect(
     collectionOne,
     {
     LookupID: 1,
     Invoice: 32
     },
     {
     LookupID: 2,
     Invoice: 48
     },
     {
     LookupID: 3,
     Invoice: 49
     },
     {
     LookupID: 4,
     Invoice: 52
     },
     {
     LookupID: 5,
     Invoice: 67
     }
    );
    ClearCollect(
     collectionTwo,
     {LookupID: 2},
     {LookupID: 4},
     {LookupID: 5}
    );
    ClearCollect(
     matchedCollection,
     Filter(
     collectionOne,
     LookupID in ForAll(
     collectionTwo,
     LookupID
     )
     )
    );

     

     

     


    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.

  • Verified answer
    mmbr1606 Profile Picture
    14,605 Super User 2025 Season 2 on at

    hey @GreenFrog 

     

    can u try this:

    ClearCollect(
     MatchingInvoices,
     Filter(
     collectionOne,
     LookupID in collectionTwo.LookupID
     )
    )
    

    you would need to rename to your needs 

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

  • GreenFrog Profile Picture
    53 on at

    thank for looking at this for me. 😀

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard