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 Apps / How to filter a list f...
Power Apps
Answered

How to filter a list for items referenced in another list

(0) ShareShare
ReportReport
Posted on by 302

Hi, I have a somewhat complex data structure in sharepoint where I have a main list, for example Points of Sales with basic data such as address, etc... I have another list where the Item ID of the first list is a field and that contains data about the sales management, one field being the Area Manager. I want to query the first list for all items where the Area Manager is X.

 

For example main list contains:

IDPOSNamePOSAddressPOSCityPOSZip
1POS APOS Address APOS City APOS Zip A
2POS BPOS Address BPOS City BPOS Zip B
3POS CPOS Address CPOS City CPOS Zip C
4POS DPOS Address DPOS City DPOS Zip D
5POS EPOS Address EPOS City EPOS Zip E
...    

 

And the Sales Management list:

 

TitlePOSIDAreaManagerPOSManager
North1 (points to POS A)JohnJulie
North4 (points to POS D)JohnPatrick
East2 (points to POS B)AdamJames
North5 (points to POS E)JohnMark
...   

 

So I want to query the main list where the area manager is John, and it should return records 1, 2 and 5 ... In other words, query the main list for all items for which an item in the sales list (Sales.POSID = Main.ID) exists where the area manager is John.

 

Stephane

Categories:
  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    Hi @bouillons ,

    Firstly the With() statement is only to avoid the Delegation Warning you will get on the Relational Lookup and is also assuming your Sales Management list item numbers are under your (500-2000) Delegation limit.

    With(
     {wSales:SalesManagementList},
     Filter(
     MainList,
     ID=LookUp(
     wSales,
     AreaManager=YourManagerValue
     ).POSID
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • bouillons Profile Picture
    302 on at

    You rock ! Thanks for your time and effort Warren. This relational lookup is new to me. The only thing that is not yet as expected, is that it only returns the first matching record. In other words and to continue on the example, when looking for John, my result gallery only shows the first Point of Sales (1). I was expecting the 1, 2 and 5 records to show up.

    Stephane

  • Verified answer
    WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    Thanks @bouillons,

    You are correct - the LookUp will return 1 item - I cannot test this presently, but try

    With(
     {wSales:SalesManagementList},
     Filter(
     MainList,
     ID in Filter(
     wSales,
     AreaManager=YourManagerValue
     ).POSID
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

  • bouillons Profile Picture
    302 on at

    Thanks again for your time and effort Darren, that worked and solved my problem in this scenario. 

    For my education, do you know if there is a delegated way of achieving the same on sharepoint ?

    Stephane

  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    Hi @bouillons ,

    I have a blog on Delegation that sets out some of the workarounds (and explains what Delegation is) that may be suitable, although relational lookups are simply not Delegable.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 339 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 289

#3
Mohsin Ali Profile Picture

Mohsin Ali 228

Last 30 days Overall leaderboard