Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Using Connectors
Answered

Filter a SharePoint Library view from List B within in List A Form using List A form "Field"

(0) ShareShare
ReportReport
Posted on by 79

I have a SharePoint List (List A) form built in PowerApps.  The form was built using the SharePoint list form option from the list settings.  I also have a SharePoint Library (List B) where documents related to specific List A items are stored.  There may be many List B documents related to one List A item. 

 

Both List A and List B have a field that contains a generated "MatterID" and the List A MatterID value is copied to the List B Matter ID when documents are loaded into the library.  So I have a field that I need to compare in both List A and List B.  I want to display the List B documents that are related to an item in List A inside the list A PowerApp form. 

 

In days past, using InfoPath, this was very very easy to accomplish because the InfoPath form for List A displayed in a webpart and a ListB webpart  could be added to the page and filtered by any field in the List A webpart (Get Filter Values from...).  That is no longer possible thanks to the untimely death of InfoPath in my environment.

 

The field MatterID in List A is a calculated field so I move its value to another field called MatterIDStored where it is stored as text when record is created.  So, the comparison is MatterIDStored to LMatterID (the library field).  

 

I created a gallery in my List A form that uses List B as a source.  I have tried multiple methods to make this comparison and pull in a filtered view of the library based on the MatterIDStored value in List A.  Nothing works because the formulas require a "value" as opposed to a field reference to work.  I tested this as shown below.  In the photo clip, the blue area of form is List A.  The light green area is a gallery view of List B.  If I insert an actual value for the LMatterID ("2021-Dec-15-1069089:41:22") in the formula for the gallery then it displays properly as shown here.  Basically I have "hard-wired" the result by setting the formula to: Filter('Exec Sec Library I', LMatterID = "2021-Dec-15-1069089:41:22").

 

billbattny_0-1640112339133.png

If, however, I use a field "MatterIDStored" instead of the value in that field then the formula does not work.  It returns errors because the reference to "MatterIDStored" is not valid in the Gallery.  Note that I have tried doing the same with global variable but that also fails.   How do make this work using a field instead of the value in that field?  Something that was so simple to do with InfoPath and WebParts now seems impossible.

 

  • Verified answer
    billbattny Profile Picture
    79 on at
    Re: Filter a SharePoint Library view from List B within in List A Form using List A form "Field"

    Thank you very much Alaa.  This worked perfectly.

  • alaabitar Profile Picture
    1,503 Super User 2024 Season 1 on at
    Re: Filter a SharePoint Library view from List B within in List A Form using List A form "Field"

    Hello,

     

    Basically you have to reference the selected item of your gallery so your filter should look like 

    Filter('Exec Sec Library I', LMatterID = Gallery1.Selected.MatterIDStored)

     

    Best regards,

    Alaa

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1

Featured topics