Showing results for 
Search instead for 
Did you mean: 
Not applicable

Filter documents associated via lookups

I have a Document Library, within that library I have a lookup to an Office List.  Multiple Offices can be selected in this lookup.  The lookup uses the Title field from the Offices list.


If I have a Gallery that lists the Offices by their title and I select an Office, how can I make another gallery filter the Document Library to the Office selected to only show documents associated to that Office?


Thanks for your help!

Super User
Super User

Hi @Anonymous ,

Using the list name Office and Title as the lookup field and I will call your galleries Gallery1 and Gallery2

The Items property of Gallery2 would be

   Title = Gallery1.Selected.Title

This would display only the Title records matching that selected in Gallery1 


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.

Not applicable

WarrenBelz thanks for the reply!


I'm a little confused.  Your example seems to be filtering offices, not the documents.  So if I have an Offices list and a Bills Document Library.  Here's the code I came up with, but it's still not working.


In Gallery2.Items I have "Filter(Bills, [@Offices].Title = Gallery1.Selected)".


Now the when I get to the source part of the Filter function, it gives me two options "Offices" and "[@Offices]".  Which one should I use?



Hi @Anonymous ,

OK you have a list Offices and a library Bills. The field in Offices is Title and the matching field in Bills is Office ?

Can you please confirm this and give me the name and Items property of the first gallery

Hi @Anonymous ,


Since the LookUp column is multi-selection, the Lookup column is actually a nested table with Value and ID Column(from selected Office records), so you can try this, It will filter out all documents that lookup to the selected Office.


Filter(Bills,Gallery1.Selected.ID in 'LookUp Column Name'.Id)


Note: 'in' operator is not delegable for sharepoint.



Hi @Anonymous ,

@v-siky-msft has given a scenario where the first gallery is based on Bills. Is this the case or is it based on Office - as you have said I have a Gallery that lists the Offices by their title and I select an Office and I have been basing my thoughts in that direction.

I will cover the In operator in the syntax as you have mentioned possible multiple choices of offices and there may be a Collection solution to this depending on the size of your list. The multi-select (complex field type) certainly applies if the list is based on Bills and if so the solution below is correct.


Hi @WarrenBelz ,


The first gallery is based on Office list, this is certain.

In my understanding, the user selects one record from Office Gallery1, and the Gallery2 displays related Documents from Bill library, (the related records mean lookup column contains the selected Office).

Take an example:


If I select 2 in the left gallery, the right gallery (from F1) will show the related 3 documents records.



Super User
Super User

Thanks @v-siky-msft ,

I did not manage to turn that corner - mainly because I do not use lookup columns (I do it all in PowerApps).

I was heading in the direction of something like

Filter(Bills,Gallery1.Selected.Company in Company.Value)

if yours works, @Anonymous does not have to look any further.

Helpful resources

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (983)